Version: 9.16.0
Home
Loading...
Searching...
No Matches
Auxiliary data structures and methods

Data Structures

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

Functions

 RaiseIfFailed (Method_name, Operation)
 Raise an Error, containing the Method_name, if Operation is Failed.
 
 ParseParameters (*parameters)
 Return list of variables value from salome notebook.
 
 ParseList (list)
 Return list of variables value from salome notebook.
 
 ParseSketcherCommand (command)
 Return list of variables value from salome notebook.
 
 PackData (data)
 Helper function which can be used to pack the passed string to the byte data.
 
 ReadTexture (fname)
 Read bitmap texture from the text file.
 
 EnumToLong (theItem)
 Returns a long value from enumeration type Can be used for CORBA enumerator types like GEOM.shape_type.
 
 init_geom (self)
 
 GetPluginOperations (self, libraryName)
 
 DumpPython (self, theIsPublished=True, theIsMultiFile=True)
 Dump component to the Python script This method overrides IDL function to allow default values for the parameters.
 
 SubShapeName (self, aSubObj, aMainObj)
 Get name for sub-shape aSubObj of shape aMainObj.
 
 hideInStudy (self, obj)
 Unpublish object in study.
 
 MakeCopy (self, theOriginal, theName=None)
 Create a copy of the given object.
 
 addPath (self, Path)
 Add Path to load python scripts from.
 
 LoadTexture (self, Path)
 Load marker texture from the file.
 
 getObjectID (self, obj)
 Get internal name of the object based on its study entry.
 
 AddTexture (self, Width, Height, Texture, RowData=False)
 Add marker texture.
 
 TransferData (self, theObjectFrom, theObjectTo, theFindMethod=GEOM.FSM_GetInPlace)
 Transfer not topological data from one GEOM object to another.
 

Variables

dict ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
 Enumeration ShapeType as a dictionary.
 
 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

◆ RaiseIfFailed()

RaiseIfFailed (   Method_name,
  Operation 
)

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

◆ ParseParameters()

ParseParameters ( *  parameters)

Return list of variables value from salome notebook.

References geomBuilder.ParseParameters().

◆ ParseList()

ParseList (   list)

Return list of variables value from salome notebook.

◆ ParseSketcherCommand()

ParseSketcherCommand (   command)

Return list of variables value from salome notebook.

◆ PackData()

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

◆ ReadTexture()

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 geomBuilder class. For example,

from salome.geom import geomBuilder
geompy = geomBuilder.New()
texture = geompy.readtexture('mytexture.dat')
texture = geompy.AddTexture(*texture)
obj.SetMarkerTexture(texture)
New(instance=None)
Create a new geomBuilder instance.The geomBuilder class provides the Python interface to GEOM operati...
Definition tmp/geomBuilder.py:8920
Parameters
fnametexture file name
Returns
sequence of tree values: texture's width, height in pixels and its byte stream

References geomBuilder.PackData().

◆ EnumToLong()

EnumToLong (   theItem)

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

Parameters
theItemenumeration type

◆ init_geom()

init_geom (   self)

◆ GetPluginOperations()

GetPluginOperations (   self,
  libraryName 
)

◆ DumpPython()

DumpPython (   self,
  theIsPublished = True,
  theIsMultiFile = True 
)

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

◆ SubShapeName()

SubShapeName (   self,
  aSubObj,
  aMainObj 
)

Get name for sub-shape aSubObj of shape aMainObj.

Example

References geomBuilder.ShapesOp.

◆ hideInStudy()

hideInStudy (   self,
  obj 
)

Unpublish object in study.

Parameters
objthe object to be unpublished

References geomBuilder.myBuilder, and geomBuilder.myStudy.

◆ MakeCopy()

MakeCopy (   self,
  theOriginal,
  theName = None 
)

Create a copy of the given object.

Parameters
theOriginalgeometry object for copy
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM_Object, containing the copied shape.

Example

References geomBuilder._autoPublish(), geomBuilder.InsertOp, geomBuilder.MakeCopy(), and geomBuilder.RaiseIfFailed().

◆ addPath()

addPath (   self,
  Path 
)

Add Path to load python scripts from.

Parameters
Patha path to load python scripts from

◆ LoadTexture()

LoadTexture (   self,
  Path 
)

Load marker texture from the file.

Parameters
Patha path to the texture file
Returns
unique texture identifier

References geomBuilder.InsertOp, geomBuilder.LoadTexture(), and geomBuilder.RaiseIfFailed().

◆ getObjectID()

getObjectID (   self,
  obj 
)

Get internal name of the object based on its study entry.

Note
This method does not provide an unique identifier of the geometry object.
This is internal function of GEOM component, though it can be used outside it for appropriate reason (e.g. for identification of geometry object).
Parameters
objgeometry object
Returns
unique object identifier

◆ AddTexture()

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 geomBuilder.AddTexture(), geomBuilder.InsertOp, geomBuilder.PackData(), and geomBuilder.RaiseIfFailed().

◆ TransferData()

TransferData (   self,
  theObjectFrom,
  theObjectTo,
  theFindMethod = GEOM.FSM_GetInPlace 
)

Transfer not topological data from one GEOM object to another.

Parameters
theObjectFromthe source object of non-topological data
theObjectTothe destination object of non-topological data
theFindMethodmethod to search sub-shapes of theObjectFrom in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old. Other values of GEOM.find_shape_method are not supported.
Returns
True in case of success; False otherwise.

Example

References geomBuilder.InsertOp, geomBuilder.RaiseIfFailed(), and geomBuilder.TransferData().

Variable Documentation

◆ ShapeType

dict ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
static

Enumeration ShapeType as a dictionary.


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

◆ kind

kind = GEOM.GEOM_IKindOfShape
static

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]
  • SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
  • WIRE: [info.CLOSED / info.UNCLOSED 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 v1x v1y v1z v2x v2y v2z]
  • ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2 v1x v1y v1z v2x v2y v2z]
  • LINE: [xo yo zo dx dy dz]
  • SEGMENT: [x1 y1 z1 x2 y2 z2]
  • CRV_BSPLINE: [periodicity degree nb_poles nb_knots nb_weights nb_multiplicities xi yi zi ki wi mi]
  • CRV_BEZIER: [nb_poles nb_weights xi yi zi wi]
  • HYPERBOLA: [xc yc zc dx dy dz R_1 R_2 v1x v1y v1z v2x v2y v2z]
  • PARABOLA: [xc yc zc dx dy dz F v1x v1y v1z v2x v2y v2z]
  • EDGE: [nb_vertices]
  • VERTEX: [x y z]
  • LCS: [x y z xx xy xz yx yy yz zx zy zz]