Back to index

salome-geom  6.5.0
Classes | Functions | Variables
Auxiliary data structures and methods

Classes

class  geompyDC.info
 Information about closed/unclosed state of shell or wire. More...

Functions

def geompyDC.RaiseIfFailed
 Raise an Error, containing the Method_name, if Operation is Failed.
def geompyDC.ParseParameters
 Return list of variables value from salome notebook.
def geompyDC.ParseList
 Return list of variables value from salome notebook.
def geompyDC.ParseSketcherCommand
 Return list of variables value from salome notebook.
def geompyDC.PackData
 Helper function which can be used to pack the passed string to the byte data.
def geompyDC.ReadTexture
 Read bitmap texture from the text file.
def geompyDC.EnumToLong
 Returns a long value from enumeration type Can be used for CORBA enumerator types like GEOM.shape_type.
def geompyDC.geompyDC.init_geom
def geompyDC.geompyDC.DumpPython
 Dump component to the Python script This method overrides IDL function to allow default values for the parameters.
def geompyDC.geompyDC.SubShapeName
 Get name for sub-shape aSubObj of shape aMainObj.
def geompyDC.geompyDC.addToStudy
 Publish in study aShape with name aName.
def geompyDC.geompyDC.addToStudyInFather
 Publish in study aShape with name aName as sub-object of previously published aFather.
def geompyDC.geompyDC.hideInStudy
 Unpublish object in study.
def geompyDC.geompyDC.MakeCopy
 Create a copy of the given object.
def geompyDC.geompyDC.addPath
 Add Path to load python scripts from.
def geompyDC.geompyDC.LoadTexture
 Load marker texture from the file.
def geompyDC.geompyDC.getObjectID
 Get entry of the object.
def geompyDC.geompyDC.AddTexture
 Add marker texture.

Variables

dictionary geompyDC.ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
 Enumeration ShapeType as a dictionary.
 geompyDC.kind = GEOM.GEOM_IKindOfShape
 Kinds of shape in terms of GEOM.GEOM_IKindOfShape.shape_kind enumeration and a list of parameters, describing the shape.

Class Documentation

class geompyDC::info

Information about closed/unclosed state of shell or wire.

Information about closed/unclosed state of shell or wire

Definition at line 360 of file geompyDC.py.

Static Public Attributes

int UNKNOWN = 0
int CLOSED = 1
int UNCLOSED = 2

Member Data Documentation

int geompyDC.info.CLOSED = 1 [static]

Definition at line 365 of file geompyDC.py.

int geompyDC.info.UNCLOSED = 2 [static]

Definition at line 366 of file geompyDC.py.

int geompyDC.info.UNKNOWN = 0 [static]

Definition at line 364 of file geompyDC.py.


Function Documentation

def geompyDC.geompyDC.addPath (   self,
  Path 
)

Add Path to load python scripts from.

Parameters:
Patha path to load python scripts from
Add Path to load python scripts from

Parameters:
    Path a path to load python scripts from

Definition at line 8547 of file geompyDC.py.

08547 
08548         def addPath(self,Path):
08549             """
08550             Add Path to load python scripts from
08551 
08552             Parameters:
08553                 Path a path to load python scripts from
08554             """
08555             if (sys.path.count(Path) < 1):
08556                 sys.path.append(Path)
08557                 pass
08558             pass

def geompyDC.geompyDC.AddTexture (   self,
  Width,
  Height,
  Texture,
  RowData = False 
)

Add marker texture.

Width and Height parameters specify width and height of the texture in pixels. If RowData is True, Texture parameter should represent texture data packed into the byte array. If RowData is False (default), Texture parameter should be unpacked string, in which '1' symbols represent opaque pixels and '0' represent transparent pixels of the texture bitmap.

Parameters:
Widthtexture width in pixels
Heighttexture height in pixels
Texturetexture data
RowDataif True, Texture data are packed in the byte stream
Returns:
unique texture identifier
Add marker texture. Width and Height parameters
specify width and height of the texture in pixels.
If RowData is True, Texture parameter should represent texture data
packed into the byte array. If RowData is False (default), Texture
parameter should be unpacked string, in which '1' symbols represent opaque
pixels and '0' represent transparent pixels of the texture bitmap.

Parameters:
    Width texture width in pixels
    Height texture height in pixels
    Texture texture data
    RowData if True, Texture data are packed in the byte stream

Returns:
    return unique texture identifier

Definition at line 8616 of file geompyDC.py.

08616 
08617         def AddTexture(self, Width, Height, Texture, RowData=False):
08618             """
08619             Add marker texture. Width and Height parameters
08620             specify width and height of the texture in pixels.
08621             If RowData is True, Texture parameter should represent texture data
08622             packed into the byte array. If RowData is False (default), Texture
08623             parameter should be unpacked string, in which '1' symbols represent opaque
08624             pixels and '0' represent transparent pixels of the texture bitmap.
08625 
08626             Parameters:
08627                 Width texture width in pixels
08628                 Height texture height in pixels
08629                 Texture texture data
08630                 RowData if True, Texture data are packed in the byte stream
08631 
08632             Returns:
08633                 return unique texture identifier
08634             """
08635             if not RowData: Texture = PackData(Texture)
08636             ID = self.InsertOp.AddTexture(Width, Height, Texture)
08637             RaiseIfFailed("AddTexture", self.InsertOp)
08638             return ID

Here is the call graph for this function:

def geompyDC.geompyDC.addToStudy (   self,
  aShape,
  aName,
  doRestoreSubShapes = False,
  theArgs = [],
  theFindMethod = GEOM.FSM_GetInPlace,
  theInheritFirstArg = False 
)

Publish in study aShape with name aName.

Parameters:
aShapethe shape to be published
aNamethe name for the shape
doRestoreSubShapesif True, finds and publishes also sub-shapes of aShape, corresponding to its arguments and published sub-shapes of arguments
theArgs,theFindMethod,theInheritFirstArgsee RestoreSubShapes() for these arguments description
Returns:
study entry of the published shape in form of string

Example

Publish in study aShape with name aName

Parameters:
    aShape the shape to be published
    aName  the name for the shape
    doRestoreSubShapes if True, finds and publishes also
           sub-shapes of aShape, corresponding to its arguments
           and published sub-shapes of arguments
    theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
                                 these arguments description

Returns:
    study entry of the published shape in form of string

Example of usage:
    id_block1 = geompy.addToStudy(Block1, "Block 1")

Definition at line 462 of file geompyDC.py.

00462 
00463                        theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
00464             """
00465             Publish in study aShape with name aName
00466 
00467             Parameters:
00468                 aShape the shape to be published
00469                 aName  the name for the shape
00470                 doRestoreSubShapes if True, finds and publishes also
00471                                    sub-shapes of aShape, corresponding to its arguments
00472                                    and published sub-shapes of arguments
00473                 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
00474                                                          these arguments description
00475 
00476             Returns:
00477                 study entry of the published shape in form of string
00478 
00479             Example of usage:
00480                 id_block1 = geompy.addToStudy(Block1, "Block 1")
00481             """
00482             # Example: see GEOM_TestAll.py
00483             try:
00484                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
00485                 if doRestoreSubShapes:
00486                     self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
00487                                             theFindMethod, theInheritFirstArg, True )
00488             except:
00489                 print "addToStudy() failed"
00490                 return ""
00491             return aShape.GetStudyEntry()

Here is the call graph for this function:

Here is the caller graph for this function:

def geompyDC.geompyDC.addToStudyInFather (   self,
  aFather,
  aShape,
  aName 
)

Publish in study aShape with name aName as sub-object of previously published aFather.

Parameters:
aFatherpreviously published object
aShapethe shape to be published as sub-object of aFather
aNamethe name for the shape
Returns:
study entry of the published shape in form of string Example
Publish in study aShape with name aName as sub-object of previously published aFather

Parameters:
    aFather previously published object
    aShape the shape to be published as sub-object of aFather
    aName  the name for the shape

Returns:
    study entry of the published shape in form of string

Definition at line 499 of file geompyDC.py.

00499 
00500         def addToStudyInFather(self, aFather, aShape, aName):
00501             """
00502             Publish in study aShape with name aName as sub-object of previously published aFather
00503 
00504             Parameters:
00505                 aFather previously published object
00506                 aShape the shape to be published as sub-object of aFather
00507                 aName  the name for the shape
00508 
00509             Returns:
00510                 study entry of the published shape in form of string
00511             """
00512             # Example: see GEOM_TestAll.py
00513             try:
00514                 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
00515             except:
00516                 print "addToStudyInFather() failed"
00517                 return ""
00518             return aShape.GetStudyEntry()

Here is the call graph for this function:

Here is the caller graph for this function:

def geompyDC.geompyDC.DumpPython (   self,
  theStudy,
  theIsPublished = True,
  theIsMultiFile = True 
)

Dump component to the Python script This method overrides IDL function to allow default values for the parameters.

Dump component to the Python script
This method overrides IDL function to allow default values for the parameters.

Definition at line 425 of file geompyDC.py.

00425 
00426         def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
00427             """
00428             Dump component to the Python script
00429             This method overrides IDL function to allow default values for the parameters.
00430             """
00431             return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)

def geompyDC.EnumToLong (   theItem)

Returns a long value from enumeration type Can be used for CORBA enumerator types like GEOM.shape_type.

Parameters:
theItemenumeration type
Returns a long value from enumeration type
Can be used for CORBA enumerator types like geompy.ShapeType

Parameters:
    theItem enumeration type

Definition at line 304 of file geompyDC.py.

00304 
00305 def EnumToLong(theItem):
00306     """
00307     Returns a long value from enumeration type
00308     Can be used for CORBA enumerator types like geompy.ShapeType
00309 
00310     Parameters:
00311         theItem enumeration type
00312     """
00313     ret = theItem
00314     if hasattr(theItem, "_v"): ret = theItem._v
00315     return ret

Here is the caller graph for this function:

def geompyDC.geompyDC.getObjectID (   self,
  obj 
)

Get entry of the object.

Parameters:
objgeometry object
Returns:
unique object identifier
Get entry of the object

Parameters:
    obj geometry object

Returns:
    unique object identifier

Definition at line 8582 of file geompyDC.py.

08582 
08583         def getObjectID(self, obj):
08584             """
08585             Get entry of the object
08586 
08587             Parameters:
08588                 obj geometry object
08589 
08590             Returns:
08591                 unique object identifier
08592             """
08593             ID = ""
08594             entry = salome.ObjectToID(obj)
08595             if entry is not None:
08596                 lst = entry.split(":")
08597                 if len(lst) > 0:
08598                     ID = lst[-1] # -1 means last item in the list            
08599                     return "GEOM_" + ID
08600             return ID
08601                 
08602             

def geompyDC.geompyDC.hideInStudy (   self,
  obj 
)

Unpublish object in study.

Parameters:
objthe object to be unpublished
Unpublish object in study

Parameters:
    obj the object to be unpublished

Definition at line 522 of file geompyDC.py.

00522 
00523         def hideInStudy(self, obj):
00524             """
00525             Unpublish object in study
00526 
00527             Parameters:
00528                 obj the object to be unpublished
00529             """
00530             ior = salome.orb.object_to_string(obj)
00531             aSObject = self.myStudy.FindObjectIOR(ior)
00532             if aSObject is not None:
00533                 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
00534                 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
00535                 drwAttribute.SetDrawable(False)
00536                 pass

Here is the call graph for this function:

def geompyDC.geompyDC.init_geom (   self,
  theStudy 
)

Definition at line 393 of file geompyDC.py.

00393 
00394         def init_geom(self,theStudy):
00395             self.myStudy = theStudy
00396             self.myStudyId = self.myStudy._get_StudyId()
00397             self.myBuilder = self.myStudy.NewBuilder()
00398             self.father = self.myStudy.FindComponent("GEOM")
00399             if self.father is None:
00400                 self.father = self.myBuilder.NewComponent("GEOM")
00401                 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
00402                 FName = A1._narrow(SALOMEDS.AttributeName)
00403                 FName.SetValue("Geometry")
00404                 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
00405                 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
00406                 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
00407                 self.myBuilder.DefineComponentInstance(self.father,self)
00408                 pass
00409             self.BasicOp  = self.GetIBasicOperations    (self.myStudyId)
00410             self.CurvesOp = self.GetICurvesOperations   (self.myStudyId)
00411             self.PrimOp   = self.GetI3DPrimOperations   (self.myStudyId)
00412             self.ShapesOp = self.GetIShapesOperations   (self.myStudyId)
00413             self.HealOp   = self.GetIHealingOperations  (self.myStudyId)
00414             self.InsertOp = self.GetIInsertOperations   (self.myStudyId)
00415             self.BoolOp   = self.GetIBooleanOperations  (self.myStudyId)
00416             self.TrsfOp   = self.GetITransformOperations(self.myStudyId)
00417             self.LocalOp  = self.GetILocalOperations    (self.myStudyId)
00418             self.MeasuOp  = self.GetIMeasureOperations  (self.myStudyId)
00419             self.BlocksOp = self.GetIBlocksOperations   (self.myStudyId)
00420             self.GroupOp  = self.GetIGroupOperations    (self.myStudyId)
00421             self.AdvOp    = self.GetIAdvancedOperations (self.myStudyId)
00422             pass

def geompyDC.geompyDC.LoadTexture (   self,
  Path 
)

Load marker texture from the file.

Parameters:
Patha path to the texture file
Returns:
unique texture identifier
Load marker texture from the file

Parameters:
    Path a path to the texture file
    
Returns:
    unique texture identifier

Definition at line 8563 of file geompyDC.py.

08563 
08564         def LoadTexture(self, Path):
08565             """
08566             Load marker texture from the file
08567             
08568             Parameters:
08569                 Path a path to the texture file
08570                 
08571             Returns:
08572                 unique texture identifier
08573             """
08574             # Example: see GEOM_TestAll.py
08575             ID = self.InsertOp.LoadTexture(Path)
08576             RaiseIfFailed("LoadTexture", self.InsertOp)
08577             return ID

Here is the call graph for this function:

def geompyDC.geompyDC.MakeCopy (   self,
  theOriginal 
)

Create a copy of the given object.

Parameters:
theOriginalgeometry object for copy
Returns:
unique object identifier

Example

Create a copy of the given object

Paremeters:
    theOriginal geometry object for copy

Returns:
    unique object identifier

Example of usage: Copy = geompy.MakeCopy(Box)

Definition at line 8527 of file geompyDC.py.

08527 
08528         def MakeCopy(self,theOriginal):
08529             """
08530             Create a copy of the given object
08531 
08532             Paremeters:
08533                 theOriginal geometry object for copy
08534 
08535             Returns:
08536                 unique object identifier
08537 
08538             Example of usage: Copy = geompy.MakeCopy(Box)
08539             """
08540             # Example: see GEOM_TestAll.py
08541             anObj = self.InsertOp.MakeCopy(theOriginal)
08542             RaiseIfFailed("MakeCopy", self.InsertOp)
08543             return anObj

Here is the call graph for this function:

def geompyDC.PackData (   data)

Helper function which can be used to pack the passed string to the byte data.

Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes. If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception. For example,

 val = PackData("10001110") # val = 0xAE
 val = PackData("1")        # val = 0x80
Parameters:
dataunpacked data - a string containing '1' and '0' symbols
Returns:
data packed to the byte stream
Helper function which can be used to pack the passed string to the byte data.
Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.

Parameters:
    data unpacked data - a string containing '1' and '0' symbols

Returns:
    data packed to the byte stream
    
Example of usage:
    val = PackData("10001110") # val = 0xAE
    val = PackData("1")        # val = 0x80

Definition at line 192 of file geompyDC.py.

00192 
00193 def PackData(data):
00194     """
00195     Helper function which can be used to pack the passed string to the byte data.
00196     Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
00197     If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
00198 
00199     Parameters:
00200         data unpacked data - a string containing '1' and '0' symbols
00201 
00202     Returns:
00203         data packed to the byte stream
00204         
00205     Example of usage:
00206         val = PackData("10001110") # val = 0xAE
00207         val = PackData("1")        # val = 0x80
00208     """
00209     bytes = len(data)/8
00210     if len(data)%8: bytes += 1
00211     res = ""
00212     for b in range(bytes):
00213         d = data[b*8:(b+1)*8]
00214         val = 0
00215         for i in range(8):
00216             val *= 2
00217             if i < len(d):
00218                 if d[i] == "1": val += 1
00219                 elif d[i] != "0":
00220                     raise "Invalid symbol %s" % d[i]
00221                 pass
00222             pass
00223         res += chr(val)
00224         pass
00225     return res

Here is the caller graph for this function:

def geompyDC.ParseList (   list)

Return list of variables value from salome notebook.

Definition at line 131 of file geompyDC.py.

00131 
00132 def ParseList(list):
00133     Result = []
00134     StringResult = ""
00135     for parameter in list:
00136         if isinstance(parameter,str) and notebook.isVariable(parameter):
00137             Result.append(str(notebook.get(parameter)))
00138             pass
00139         else:
00140             Result.append(str(parameter))
00141             pass
00142 
00143         StringResult = StringResult + str(parameter)
00144         StringResult = StringResult + ":"
00145         pass
00146     StringResult = StringResult[:len(StringResult)-1]
00147     return Result, StringResult

Here is the caller graph for this function:

def geompyDC.ParseParameters (   parameters)

Return list of variables value from salome notebook.

Definition at line 99 of file geompyDC.py.

00099 
00100 def ParseParameters(*parameters):
00101     Result = []
00102     StringResult = []
00103     for parameter in parameters:
00104         if isinstance(parameter, list):
00105             lResults = ParseParameters(*parameter)
00106             if len(lResults) > 0:
00107                 Result.append(lResults[:-1])
00108                 StringResult += lResults[-1].split(":")
00109                 pass
00110             pass
00111         else:
00112             if isinstance(parameter,str):
00113                 if notebook.isVariable(parameter):
00114                     Result.append(notebook.get(parameter))
00115                 else:
00116                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
00117                 pass
00118             else:
00119                 Result.append(parameter)
00120                 pass
00121             StringResult.append(str(parameter))
00122             pass
00123         pass
00124     if Result:
00125         Result.append(":".join(StringResult))
00126     else:
00127         Result = ":".join(StringResult)
00128     return Result

def geompyDC.ParseSketcherCommand (   command)

Return list of variables value from salome notebook.

Definition at line 150 of file geompyDC.py.

00150 
00151 def ParseSketcherCommand(command):
00152     Result = ""
00153     StringResult = ""
00154     sections = command.split(":")
00155     for section in sections:
00156         parameters = section.split(" ")
00157         paramIndex = 1
00158         for parameter in parameters:
00159             if paramIndex > 1 and parameter.find("'") != -1:
00160                 parameter = parameter.replace("'","")
00161                 if notebook.isVariable(parameter):
00162                     Result = Result + str(notebook.get(parameter)) + " "
00163                     pass
00164                 else:
00165                     raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
00166                     pass
00167                 pass
00168             else:
00169                 Result = Result + str(parameter) + " "
00170                 pass
00171             if paramIndex > 1:
00172                 StringResult = StringResult + parameter
00173                 StringResult = StringResult + ":"
00174                 pass
00175             paramIndex = paramIndex + 1
00176             pass
00177         Result = Result[:len(Result)-1] + ":"
00178         pass
00179     Result = Result[:len(Result)-1]
00180     return Result, StringResult

Here is the caller graph for this function:

def geompyDC.RaiseIfFailed (   Method_name,
  Operation 
)

Raise an Error, containing the Method_name, if Operation is Failed.

Definition at line 93 of file geompyDC.py.

00093 
00094 def RaiseIfFailed (Method_name, Operation):
00095     if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
00096         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()

def geompyDC.ReadTexture (   fname)

Read bitmap texture from the text file.

In that file, any non-zero symbol represents '1' opaque pixel of the bitmap. A zero symbol ('0') represents transparent pixel of the texture bitmap. The function returns width and height of the pixmap in pixels and byte stream representing texture bitmap itself.

This function can be used to read the texture to the byte stream in order to pass it to the AddTexture() function of geompy class. For example,

 import geompy
 geompy.init_geom(salome.myStudy)
 texture = geompy.readtexture('mytexture.dat')
 texture = geompy.AddTexture(*texture)
 obj.SetMarkerTexture(texture)
Parameters:
fnametexture file name
Returns:
sequence of tree values: texture's width, height in pixels and its byte stream
Read bitmap texture from the text file.
In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
A zero symbol ('0') represents transparent pixel of the texture bitmap.
The function returns width and height of the pixmap in pixels and byte stream representing
texture bitmap itself.
This function can be used to read the texture to the byte stream in order to pass it to
the AddTexture() function of geompy class.

Parameters:
    fname texture file name

Returns:
    sequence of tree values: texture's width, height in pixels and its byte stream

Example of usage:
    import geompy
    geompy.init_geom(salome.myStudy)
    texture = geompy.readtexture('mytexture.dat')
    texture = geompy.AddTexture(*texture)
    obj.SetMarkerTexture(texture)

Definition at line 245 of file geompyDC.py.

00245 
00246 def ReadTexture(fname):
00247     """
00248     Read bitmap texture from the text file.
00249     In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
00250     A zero symbol ('0') represents transparent pixel of the texture bitmap.
00251     The function returns width and height of the pixmap in pixels and byte stream representing
00252     texture bitmap itself.
00253     This function can be used to read the texture to the byte stream in order to pass it to
00254     the AddTexture() function of geompy class.
00255     
00256     Parameters:
00257         fname texture file name
00258 
00259     Returns:
00260         sequence of tree values: texture's width, height in pixels and its byte stream
00261     
00262     Example of usage:
00263         import geompy
00264         geompy.init_geom(salome.myStudy)
00265         texture = geompy.readtexture('mytexture.dat')
00266         texture = geompy.AddTexture(*texture)
00267         obj.SetMarkerTexture(texture)
00268     """
00269     try:
00270         f = open(fname)
00271         lines = [ l.strip() for l in f.readlines()]
00272         f.close()
00273         maxlen = 0
00274         if lines: maxlen = max([len(x) for x in lines])
00275         lenbytes = maxlen/8
00276         if maxlen%8: lenbytes += 1
00277         bytedata=""
00278         for line in lines:
00279             if len(line)%8:
00280                 lenline = (len(line)/8+1)*8
00281                 pass
00282             else:
00283                 lenline = (len(line)/8)*8
00284                 pass
00285             for i in range(lenline/8):
00286                 byte=""
00287                 for j in range(8):
00288                     if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
00289                     else: byte += "0"
00290                     pass
00291                 bytedata += PackData(byte)
00292                 pass
00293             for i in range(lenline/8, lenbytes):
00294                 bytedata += PackData("0")
00295             pass
00296         return lenbytes*8, len(lines), bytedata
00297     except:
00298         pass
00299     return 0, 0, ""

Here is the call graph for this function:

def geompyDC.geompyDC.SubShapeName (   self,
  aSubObj,
  aMainObj 
)

Get name for sub-shape aSubObj of shape aMainObj.

Example

Get name for sub-shape aSubObj of shape aMainObj

Definition at line 435 of file geompyDC.py.

00435 
00436         def SubShapeName(self,aSubObj, aMainObj):
00437             """
00438             Get name for sub-shape aSubObj of shape aMainObj
00439             """
00440             # Example: see GEOM_TestAll.py
00441 
00442             #aSubId  = orb.object_to_string(aSubObj)
00443             #aMainId = orb.object_to_string(aMainObj)
00444             #index = gg.getIndexTopology(aSubId, aMainId)
00445             #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
00446             index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
00447             name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
00448             return name

Here is the call graph for this function:


Variable Documentation

Kinds of shape in terms of GEOM.GEOM_IKindOfShape.shape_kind enumeration and a list of parameters, describing the shape.

List of parameters, describing the shape:

  • COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
  • COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
  • SPHERE: [xc yc zc R]
    • CYLINDER: [xb yb zb dx dy dz R H]
    • BOX: [xc yc zc ax ay az]
    • ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
    • TORUS: [xc yc zc dx dy dz R_1 R_2]
    • CONE: [xb yb zb dx dy dz R_1 R_2 H]
    • POLYHEDRON: [nb_faces nb_edges nb_vertices]
    • SOLID: [nb_faces nb_edges nb_vertices]
  • SPHERE2D: [xc yc zc R]
    • CYLINDER2D: [xb yb zb dx dy dz R H]
    • TORUS2D: [xc yc zc dx dy dz R_1 R_2]
    • CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
    • DISK_CIRCLE: [xc yc zc dx dy dz R]
    • DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
    • POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
    • PLANE: [xo yo zo dx dy dz]
    • PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
    • FACE: [nb_edges nb_vertices]
  • CIRCLE: [xc yc zc dx dy dz R]
    • ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
    • ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
    • ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
    • LINE: [xo yo zo dx dy dz]
    • SEGMENT: [x1 y1 z1 x2 y2 z2]
    • EDGE: [nb_vertices]
  • VERTEX: [x y z]

Definition at line 356 of file geompyDC.py.

dictionary geompyDC.ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}

Enumeration ShapeType as a dictionary.


Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.

Definition at line 89 of file geompyDC.py.