Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages

This class provides several methods to manipulate geom objects in Salome study. More...

Public Member Functions

def __init__
 
def addShapeToStudy
 Add a GEOM shape in the study. More...
 
def removeFromStudy
 This removes the specified entry from the study. More...
 
def displayShapeByName
 Display the geometrical shape whose name in the study is shapeName. More...
 
def displayShapeByEntry
 Display the geometrical shape whose entry is given by entry. More...
 
def eraseShapeByEntry
 Erase the geometrical shape whose entry is given by entry. More...
 
def deleteShape
 This completly deletes a geom shape. More...
 
def getGeomObjectSelected
 Returns the GEOM object currently selected in the objects browser. More...
 
def getGeomObjectFromEntry
 Returns the GEOM object associated to the specified entry, (the entry is the identifier of an item in the active study) More...
 

Data Fields

 editor
 

Detailed Description

This class provides several methods to manipulate geom objects in Salome study.

The parameter studyEditor defines a StudyEditor object used to access the study. If None, the method returns a StudyEditor object on the current study.

editor

This instance attribute contains the underlying StudyEditor object. It can be used to access the study but the attribute itself should not be modified.

Constructor & Destructor Documentation

def __init__ (   self,
  studyEditor = None 
)

Member Function Documentation

def addShapeToStudy (   self,
  shape,
  shapeName,
  folderName = None 
)

Add a GEOM shape in the study.

It returns the associated entry that corresponds to the identifier of the entry in the study. This entry can be used to retrieve an object in the study. A folderName can be specified. In this case, a folder with this name is first created in the Geometry part of the study, and the shape study object is stored in this folder of the study.

Parameters
shape(GEOM object) the GEOM object defining the shape
shapeName(string) the name for this shape in the study
folderName(string) the name of a folder in the GEOM part of the study

References geomtools.getGeompy().

def removeFromStudy (   self,
  shapeStudyEntry 
)

This removes the specified entry from the study.

Note that this operation does not destroy the underlying GEOM object, neither erase the drawing in the viewer. The underlying GEOM object is returned (so that it can be destroyed)

References GeomStudyTools.getGeomObjectFromEntry().

def displayShapeByName (   self,
  shapeName,
  color = None,
  fit = True 
)

Display the geometrical shape whose name in the study is shapeName.

Parameters
shapeName(string) name of the geometrical shape
color(tuple) RGB components of the color of the shape
Returns
True if the shape was found, False otherwise

References GeomStudyTools.displayShapeByEntry().

def displayShapeByEntry (   self,
  shapeStudyEntry,
  color = None,
  fit = True 
)

Display the geometrical shape whose entry is given by entry.

You should prefer use this function instead of the displayShapeByName() which can have an unpredictible behavior in the case where several objects exist with the same name in the study.

def eraseShapeByEntry (   self,
  shapeStudyEntry 
)

Erase the geometrical shape whose entry is given by entry.

Please note that the shape is just erased from the viewer. The associated study object still exists in the study, and the geom object still exists in the GEOM engine.

def deleteShape (   self,
  shapeStudyEntry 
)

This completly deletes a geom shape.

Warning
Please be aware that to delete a geom object, you have three operations to perform:
  1. erase the shape from the viewers
  2. remove the entry from the study
  3. destroy the underlying geom object

References GeomStudyTools.eraseShapeByEntry(), and GeomStudyTools.removeFromStudy().

def getGeomObjectSelected (   self)

Returns the GEOM object currently selected in the objects browser.

References GeomStudyTools.getGeomObjectFromEntry().

def getGeomObjectFromEntry (   self,
  entry 
)

Returns the GEOM object associated to the specified entry, (the entry is the identifier of an item in the active study)

Field Documentation

editor