Back to index

salome-geom  6.5.0
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
GEOM_PY.structelem.parts.Grid Class Reference
Inheritance diagram for GEOM_PY.structelem.parts.Grid:
Inheritance graph
[legend]
Collaboration diagram for GEOM_PY.structelem.parts.Grid:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __repr__
def addOrientation
def build

Public Attributes

 xr
 yr
 zr
 vx
 vy
 vz
 offset
 groupName
 name
 geom
 baseShapesSet
 isMainShape
 color

Static Public Attributes

string DEFAULT_NAME = "Grid"

Private Member Functions

def _buildPart
def _buildGridForNormalFace
def _buildGridForCylinderFace
def _buildMarkers

Detailed Description

This class defines a grid. A grid is represented by a 2D face patterned
with small lines in the main direction of the grid frame. The valid
parameters for grids are:

* "Excentre": offset of the grid from the base face.
* "angleAlpha": angle used to build the markers (see class
  :class:`~salome.geom.structelem.orientation.Orientation2D`)
* "angleBeta": angle used to build the markers (see class
  :class:`~salome.geom.structelem.orientation.Orientation2D`)
* "Vecteur": vector used instead of the angles to build the markers (see
  class :class:`~salome.geom.structelem.orientation.Orientation2D`)
* "origAxeX": X coordinate of the origin of the axis used to determine the
  orientation of the frame in the case of a cylindrical grid.
* "origAxeY": Y coordinate of the origin of the axis used to determine the
  orientation of the frame in the case of a cylindrical grid.
* "origAxeZ": Z coordinate of the origin of the axis used to determine the
  orientation of the frame in the case of a cylindrical grid.
* "axeX": X coordinate of the axis used to determine the orientation of
  the frame in the case of a cylindrical grid.
* "axeY": Y coordinate of the axis used to determine the orientation of
  the frame in the case of a cylindrical grid.
* "axeZ": Z coordinate of the axis used to determine the orientation of
  the frame in the case of a cylindrical grid.

See class :class:`StructuralElementPart` for the description of the
other parameters.

Definition at line 798 of file parts.py.


Constructor & Destructor Documentation

def GEOM_PY.structelem.parts.Grid.__init__ (   self,
  studyId,
  groupName,
  groupGeomObj,
  parameters,
  name = DEFAULT_NAME 
)

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart2D.

Definition at line 831 of file parts.py.

00831 
00832                  name = DEFAULT_NAME):
00833         StructuralElementPart2D.__init__(self, studyId, groupName,
00834                                          groupGeomObj, parameters, name)
00835         self.xr = self._getParameter(["origAxeX"])
00836         self.yr = self._getParameter(["origAxeY"])
00837         self.zr = self._getParameter(["origAxeZ"])
00838         self.vx = self._getParameter(["axeX"])
00839         self.vy = self._getParameter(["axeY"])
00840         self.vz = self._getParameter(["axeZ"])
00841         logger.debug(repr(self))


Member Function Documentation

Definition at line 174 of file parts.py.

00174 
00175     def __repr__(self):
00176         reprdict = self.__dict__.copy()
00177         del reprdict["_parameters"]
00178         del reprdict["groupName"]
00179         del reprdict["_groupGeomObj"]
00180         del reprdict["_paramUserName"]
00181         del reprdict["name"]
00182         del reprdict["geom"]
00183         del reprdict["baseShapesSet"]
00184         return '%s("%s", %s)' % (self.__class__.__name__, self.groupName,
00185                                  reprdict)

def GEOM_PY.structelem.parts.Grid._buildGridForCylinderFace (   self,
  face 
) [private]
Create the geometrical shapes representing the grid for a given
cylindrical face.

Definition at line 905 of file parts.py.

00905 
00906     def _buildGridForCylinderFace(self, face):
00907         """
00908         Create the geometrical shapes representing the grid for a given
00909         cylindrical face.
00910         """
00911         baseFace = self._makeFaceOffset(face, self.offset)
00912         gridList = [baseFace]
00913         
00914         # Compute display length for grid elements
00915         p1 = self.geom.MakeVertexOnSurface(baseFace, 0.0, 0.0)
00916         p2 = self.geom.MakeVertexOnSurface(baseFace, 0.1, 0.1)
00917         length = self.geom.MinDistance(p1, p2) / 2.0
00918         
00919         # Create reference vector V
00920         origPoint = self.geom.MakeVertex(self.xr, self.yr, self.zr)
00921         vPoint = self.geom.MakeTranslation(origPoint,
00922                                            self.vx, self.vy, self.vz)
00923         refVec = self.geom.MakeVector(origPoint, vPoint)
00924 
00925         for u in range(10):
00926             uParam = u * 0.1
00927             for v in range(1, 10):
00928                 vParam = v * 0.1
00929                 
00930                 # Compute the local orientation of the frame
00931                 center = self.geom.MakeVertexOnSurface(baseFace,
00932                                                        uParam, vParam)
00933                 locPlaneYZ = self.geom.MakePlaneThreePnt(origPoint, center,
00934                                                          vPoint, 1.0)
00935                 locOrient = self.geom.GetNormal(locPlaneYZ)
00936                 xPoint = self.geom.MakeTranslationVectorDistance(center,
00937                                                                  locOrient,
00938                                                                  length)
00939                 gridLine = self.geom.MakeLineTwoPnt(center, xPoint)
00940                 gridList.append(gridLine)
00941 
00942         grid = self.geom.MakeCompound(gridList)
00943         return grid

Here is the call graph for this function:

Here is the caller graph for this function:

def GEOM_PY.structelem.parts.Grid._buildGridForNormalFace (   self,
  face 
) [private]
Create the geometrical shapes representing the grid for a given
non-cylindrical face.

Definition at line 870 of file parts.py.

00870 
00871     def _buildGridForNormalFace(self, face):
00872         """
00873         Create the geometrical shapes representing the grid for a given
00874         non-cylindrical face.
00875         """
00876         baseFace = self._makeFaceOffset(face, self.offset)
00877         gridList = [baseFace]
00878         
00879         # Compute display length for grid elements
00880         p1 = self.geom.MakeVertexOnSurface(baseFace, 0.0, 0.0)
00881         p2 = self.geom.MakeVertexOnSurface(baseFace, 0.1, 0.1)
00882         length = self.geom.MinDistance(p1, p2) / 2.0
00883 
00884         for u in range(1, 10):
00885             uParam = u * 0.1
00886             for v in range(1, 10):
00887                 vParam = v * 0.1
00888                 # get tangent plane on surface by parameters
00889                 center = self.geom.MakeVertexOnSurface(baseFace,
00890                                                        uParam, vParam)
00891                 tangPlane = self.geom.MakeTangentPlaneOnFace(baseFace, uParam,
00892                                                              vParam, 1.0)
00893                 
00894                 # use the marker to get the orientation of the frame
00895                 normal = self.geom.GetNormal(tangPlane)
00896                 marker = self._orientation.buildMarker(self.geom, center,
00897                                                        normal, False)
00898                 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz] = self.geom.GetPosition(marker)
00899                 xPoint = self.geom.MakeTranslation(center, Xx * length,
00900                                                    Xy * length, Xz * length)
00901                 gridLine = self.geom.MakeLineTwoPnt(center, xPoint)
00902                 gridList.append(gridLine)
00903         grid = self.geom.MakeCompound(gridList)
00904         return grid

Here is the call graph for this function:

Here is the caller graph for this function:

Create the markers defining the orientation of the grid.

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart.

Definition at line 944 of file parts.py.

00944 
00945     def _buildMarkers(self):
00946         """
00947         Create the markers defining the orientation of the grid.
00948         """
00949         return self._buildMarkersWithOffset(self.offset)
00950 

Here is the call graph for this function:

def GEOM_PY.structelem.parts.Grid._buildPart (   self) [private]
Create the geometrical shapes representing the grid.

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart.

Definition at line 842 of file parts.py.

00842 
00843     def _buildPart(self):
00844         """
00845         Create the geometrical shapes representing the grid.
00846         """
00847         subShapes = self._getSubShapes()
00848         listGridShapes = []
00849     
00850         for subShape in subShapes:
00851             faces = self.geom.SubShapeAll(subShape,
00852                                           self.geom.ShapeType["FACE"])
00853             for face in faces:
00854                 if self.geom.KindOfShape(face)[0] == \
00855                                         self.geom.kind.CYLINDER2D and \
00856                         self.xr is not None and self.yr is not None and \
00857                         self.zr is not None and self.vx is not None and \
00858                         self.vy is not None and self.vz is not None:
00859                     shape = self._buildGridForCylinderFace(face)
00860                 else:
00861                     shape = self._buildGridForNormalFace(face)
00862                 listGridShapes.append(shape)
00863 
00864         if len(listGridShapes) == 0:
00865             return None
00866         elif len(listGridShapes) == 1:
00867             return listGridShapes[0]
00868         else:
00869             return self.geom.MakeCompound(listGridShapes)

Here is the call graph for this function:

def GEOM_PY.structelem.parts.StructuralElementPart.addOrientation (   self,
  orientParams 
) [inherited]
Add orientation information to the structural element part. See class
:class:`~salome.geom.structelem.orientation.Orientation1D` for the description
of the parameters.

Definition at line 186 of file parts.py.

00186 
00187     def addOrientation(self, orientParams):
00188         """
00189         Add orientation information to the structural element part. See class
00190         :class:`~salome.geom.structelem.orientation.Orientation1D` for the description
00191         of the parameters.
00192         """
00193         self._orientation.addParams(orientParams)

Build the geometric shapes and the markers corresponding to the
structural element part in the study `studyId`.

Definition at line 203 of file parts.py.

00203 
00204     def build(self):
00205         """
00206         Build the geometric shapes and the markers corresponding to the
00207         structural element part in the study `studyId`.
00208         """
00209         shape = self._buildPart()
00210         markers = self._buildMarkers()
00211         shape.SetColor(self.color)
00212         for marker in markers:
00213             marker.SetColor(self.color)
00214         return (shape, markers)

Here is the call graph for this function:


Member Data Documentation

Definition at line 139 of file parts.py.

Definition at line 147 of file parts.py.

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart2D.

Definition at line 828 of file parts.py.

Definition at line 138 of file parts.py.

Definition at line 133 of file parts.py.

Definition at line 140 of file parts.py.

Definition at line 137 of file parts.py.

Definition at line 650 of file parts.py.

Definition at line 837 of file parts.py.

Definition at line 838 of file parts.py.

Definition at line 839 of file parts.py.

Definition at line 834 of file parts.py.

Definition at line 835 of file parts.py.

Definition at line 836 of file parts.py.


The documentation for this class was generated from the following file: