devisor2.foundation.elements
Class Macro

java.lang.Object
  extended bydevisor2.foundation.GridItem
      extended bydevisor2.foundation.elements.Cell
          extended bydevisor2.foundation.elements.Cell2D
              extended bydevisor2.foundation.elements.Quad
                  extended bydevisor2.foundation.elements.Macro
All Implemented Interfaces:
java.io.Serializable

public class Macro
extends Quad
implements java.io.Serializable

The Macro class represents a Quad which can refine itself nonuniformly.

See Also:
Serialized Form

Field Summary
protected  int aniso
           
protected  double[] anisofaktor
           
protected  int m
          level of refinement in y direction
protected  int n
          level of refinement in x direction
 
Fields inherited from class devisor2.foundation.elements.Quad
middlez
 
Fields inherited from class devisor2.foundation.elements.Cell2D
edges, poly_world
 
Fields inherited from class devisor2.foundation.elements.Cell
children, level, marker, material_number, matrixblock, neighbours, nodes, number, parallelblock, parameters, parent, values
 
Fields inherited from class devisor2.foundation.GridItem
cc, marked, transformed, xmax, xmin, ymax, ymin
 
Constructor Summary
Macro()
          Empty constructor.
Macro(int i, int nn, int mm, Edge e1, Edge e2, Edge e3, Edge e4)
          Calls one constructor of Cell, and defines the array of edges of the cell.
 
Method Summary
 java.lang.Object clone()
          clones this Macro element shallowly, which means no nodes are recursivly cloned as well.
 void draw(java.awt.Graphics g)
          Draws the perimeter of the macro.
 void fill(java.awt.Graphics g)
          Draws the Macro filled with its color.
 double[] getAnisotropyFactors()
           
 int getAnisotropyMode()
           
 Edge getEdge(int i)
          Returns the ith edge of the cell modulo NPT, i.e.
 int getNPT()
           
 double[] getParameters()
          returns all parameters of the griditem in an int array
 java.awt.Rectangle getPerimeter()
          returns the perimeter of the Macro element, that is the smallest bounding box completely containing the Macro
 int getRefinement(int index)
           
 boolean isHit(int x, int y)
          Determines if the item has been hit by a click on the grid ALL IN SCREEN COORDINATES to avoid the snap mechanism
 boolean isInside(int[] topleft, int[] bottomright)
          Is the item inside a given rectangular area? All in WORLD COORDINATES!!!
 void performTransformation(GridTransformation trafo)
          transforms the Macro element by changing all nodes
 void setAnisotropy(int aiso, double r1, double r2, double r3)
           
 void setParameters(double[] params)
          sets all parameters of the GridItem according to the given int array
 void setRefinement(int index, int nr)
           
 java.lang.String toString()
           
 void updateInnerData()
          updates the inner variables xmin, xmax, ymin, ymax and the polygonal representation of the macro object
 
Methods inherited from class devisor2.foundation.elements.Quad
getArea, getAspectRatio, getSmallestInnerAngle, performMirror, setCell
 
Methods inherited from class devisor2.foundation.elements.Cell2D
getEdges, getNode, getNodes, setCell, setCell, setEdge, setNode, updateCellNeighbours, updateCellNodes
 
Methods inherited from class devisor2.foundation.elements.Cell
defValue, getChildren, getLevel, getMarker, getMatrixBlock, getNeighbours, getNodeAverageValue, getNumber, getParallelBlock, getParent, getValue, isRect, setLevel, setMarker, setMatrixBlock, setNumber, setParallelBlock, setValue
 
Methods inherited from class devisor2.foundation.GridItem
clearTransformedFlag, isMarked, setMarker, setMarker, unsetMarker
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

n

protected int n
level of refinement in x direction


m

protected int m
level of refinement in y direction


aniso

protected int aniso

anisofaktor

protected double[] anisofaktor
Constructor Detail

Macro

public Macro()
Empty constructor. Calls the empty constructor of Cell, and defines the array of nodes of the cell.

See Also:
Cell

Macro

public Macro(int i,
             int nn,
             int mm,
             Edge e1,
             Edge e2,
             Edge e3,
             Edge e4)
Calls one constructor of Cell, and defines the array of edges of the cell.

See Also:
Cell
Method Detail

setAnisotropy

public void setAnisotropy(int aiso,
                          double r1,
                          double r2,
                          double r3)

getAnisotropyMode

public int getAnisotropyMode()

getAnisotropyFactors

public double[] getAnisotropyFactors()

getRefinement

public int getRefinement(int index)

setRefinement

public void setRefinement(int index,
                          int nr)

getEdge

public Edge getEdge(int i)
Returns the ith edge of the cell modulo NPT, i.e. for a Quad modulo 4.

Overrides:
getEdge in class Quad
See Also:
Edge

draw

public void draw(java.awt.Graphics g)
Draws the perimeter of the macro.

Overrides:
draw in class Quad

getNPT

public int getNPT()
Overrides:
getNPT in class Quad

fill

public void fill(java.awt.Graphics g)
Draws the Macro filled with its color.

Overrides:
fill in class Quad
See Also:
Cell

updateInnerData

public void updateInnerData()
updates the inner variables xmin, xmax, ymin, ymax and the polygonal representation of the macro object

Overrides:
updateInnerData in class Quad

isInside

public boolean isInside(int[] topleft,
                        int[] bottomright)
Is the item inside a given rectangular area? All in WORLD COORDINATES!!!

Overrides:
isInside in class Quad
Parameters:
topleft - - the topleft corner of the rectangle
bottomright - - the bottom right corner of the rectangle
Returns:
true if the item is completely inside the rectangle

isHit

public boolean isHit(int x,
                     int y)
Determines if the item has been hit by a click on the grid ALL IN SCREEN COORDINATES to avoid the snap mechanism

Overrides:
isHit in class Quad
Returns:
true if the item has been hit

getPerimeter

public java.awt.Rectangle getPerimeter()
returns the perimeter of the Macro element, that is the smallest bounding box completely containing the Macro

Overrides:
getPerimeter in class Quad

performTransformation

public void performTransformation(GridTransformation trafo)
transforms the Macro element by changing all nodes

Overrides:
performTransformation in class Quad

clone

public java.lang.Object clone()
clones this Macro element shallowly, which means no nodes are recursivly cloned as well. See the GridCloner class in the backend package for more information on how cloning of entire collections is performed.

Overrides:
clone in class Quad

getParameters

public double[] getParameters()
Description copied from class: GridItem
returns all parameters of the griditem in an int array

Overrides:
getParameters in class Quad

setParameters

public void setParameters(double[] params)
Description copied from class: GridItem
sets all parameters of the GridItem according to the given int array

Overrides:
setParameters in class Quad

toString

public java.lang.String toString()
Overrides:
toString in class Quad