Version: 6.5.0
Home
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Functions | Variables
Auxiliary data structures and methods

Data Structures

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

Functions

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

Variables

dictionary geompy.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.
 geompy.kind = GEOM.GEOM_IKindOfShape
 Kinds of shape in terms of GEOM.GEOM_IKindOfShape.shape_kind enumeration and a list of parameters, describing the shape.

Detailed Description

Function Documentation

def geompy.RaiseIfFailed (   Method_name,
  Operation 
)

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

def geompy.ParseParameters (   parameters)

Return list of variables value from salome notebook.

def geompy.ParseList (   list)

Return list of variables value from salome notebook.

def geompy.ParseSketcherCommand (   command)

Return list of variables value from salome notebook.

def geompy.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
def geompy.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

References geompy.PackData().

def geompy.EnumToLong (   theItem)

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

Parameters
theItemenumeration type
def geompy.init_geom (   self,
  theStudy 
)
def geompy.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.

def geompy.SubShapeName (   self,
  aSubObj,
  aMainObj 
)

Get name for sub-shape aSubObj of shape aMainObj.

Example

References geompy.addToStudy().

def geompy.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

def geompy.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
def geompy.hideInStudy (   self,
  obj 
)

Unpublish object in study.

Parameters
objthe object to be unpublished

References geompy.RestoreSubShapes().

def geompy.MakeCopy (   self,
  theOriginal 
)

Create a copy of the given object.

Parameters
theOriginalgeometry object for copy
Returns
unique object identifier

Example

References geompy.RaiseIfFailed().

def geompy.addPath (   self,
  Path 
)

Add Path to load python scripts from.

Parameters
Patha path to load python scripts from
def geompy.LoadTexture (   self,
  Path 
)

Load marker texture from the file.

Parameters
Patha path to the texture file
Returns
unique texture identifier

References geompy.RaiseIfFailed().

def geompy.getObjectID (   self,
  obj 
)

Get entry of the object.

Parameters
objgeometry object
Returns
unique object identifier
def geompy.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

References geompy.AddTexture(), geompy.init_geom(), geompy.PackData(), and geompy.RaiseIfFailed().

Variable Documentation

dictionary geompy.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.

geompy.kind = GEOM.GEOM_IKindOfShape

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]
Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS