Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GEOM_Engine.cxx File Reference
#include "GEOM_Engine.hxx"
#include "GEOM_Field.hxx"
#include "GEOM_Function.hxx"
#include "GEOM_ISubShape.hxx"
#include "GEOM_PythonDump.hxx"
#include "GEOM_Solver.hxx"
#include "GEOM_SubShapeDriver.hxx"
#include "Sketcher_Profile.hxx"
#include <Basics_OCCTVersion.hxx>
#include "utilities.h"
#include <Basics_Utils.hxx>
#include <TDF_Tool.hxx>
#include <TDF_Data.hxx>
#include <TDF_Reference.hxx>
#include <TDF_LabelSequence.hxx>
#include <TDataStd_Integer.hxx>
#include <TDataStd_ChildNodeIterator.hxx>
#include <TFunction_Driver.hxx>
#include <TFunction_DriverTable.hxx>
#include <TDataStd_ByteArray.hxx>
#include <TDataStd_UAttribute.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDataStd_Comment.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <TColStd_HSequenceOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerTransient.hxx>
#include <Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx>
#include <set>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx>

Macros

#define COMMA   ','
 
#define O_BRACKET   '('
 
#define C_BRACKET   ')'
 
#define O_SQR_BRACKET   '['
 
#define C_SQR_BRACKET   ']'
 
#define PY_NULL   "None"
 
#define TEXTURE_LABEL_ID   1
 
#define TEXTURE_LABEL_FILE   2
 
#define TEXTURE_LABEL_WIDTH   3
 
#define TEXTURE_LABEL_HEIGHT   4
 
#define TEXTURE_LABEL_DATA   5
 

Typedefs

typedef std::map
< TCollection_AsciiString,
TCollection_AsciiString > 
TSting2StringMap
 
typedef std::map
< TCollection_AsciiString,
TObjectData
TSting2ObjDataMap
 
typedef std::map
< TCollection_AsciiString,
TObjectData * > 
TSting2ObjDataPtrMap
 
typedef std::map< int,
std::list< int > > 
TIntToListIntMap
 

Functions

static TCollection_AsciiString BuildIDFromObject (Handle(GEOM_BaseObject)&theObject)
 
static TCollection_AsciiString BuildID (Standard_Integer theDocID, const char *theEntry)
 
static Standard_Integer ExtractDocID (TCollection_AsciiString &theID)
 
bool ProcessFunction (Handle(GEOM_Function)&theFunction, TCollection_AsciiString &theScript, TCollection_AsciiString &theAfterScript, const TVariablesList &theVariables, const bool theIsPublished, TDF_LabelMap &theProcessed, std::set< TCollection_AsciiString > &theIgnoreObjs, bool &theIsDumpCollected)
 
static int GetTag (const TCollection_AsciiString &theEntry)
 
static void FillMapOfRef (const Handle(GEOM_Function)&theFunction, TIntToListIntMap &theRefMap)
 
void ReplaceVariables (TCollection_AsciiString &theCommand, const TVariablesList &theVariables)
 
 Handle (TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString &theString)
 Find IDs of sub-shapes complying with given status about surface. More...
 
void ReplaceEntriesByNames (TCollection_AsciiString &theScript, TSting2ObjDataMap &aEntry2ObjData, const bool theIsPublished, TColStd_SequenceOfAsciiString &theObjListToPublish, Standard_Integer &objectCounter, Resource_DataMapOfAsciiStringAsciiString &aNameToEntry)
 
void AddObjectColors (int theDocID, TCollection_AsciiString &theScript, const TSting2ObjDataMap &theEntry2ObjData)
 
void AddTextures (int theDocID, TCollection_AsciiString &theScript)
 
void PublishObject (TObjectData &theObjectData, TSting2ObjDataMap &theEntry2ObjData, const TSting2ObjDataPtrMap &theStEntry2ObjDataPtr, Resource_DataMapOfAsciiStringAsciiString &theNameToEntry, std::map< int, TCollection_AsciiString > &theEntryToCmdMap, std::set< TCollection_AsciiString > &theMapOfPublished)
 
static TCollection_AsciiString GetPublishCommands (const int theTag, const std::map< int, TCollection_AsciiString > &theEntryToCmdMap, const TIntToListIntMap &theMapRefs, std::set< int > &thePublished)
 Returns the string of publishing commands. Take into account that references should be published prior to the objects refer to them. More...
 
 Handle (TDocStd_Document) GEOM_Engine
 
 Handle (GEOM_BaseObject) GEOM_Engine
 
 Handle (GEOM_Object) GEOM_Engine
 Adds a new object of the type theType in the OCAF document. More...
 
Handle(TColStd_HSequenceOfAsciiString)
GEOM_Engine
Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString 
it (_studyEntry2NameMap)
 
 for (;it.More();it.Next())
 
 Handle (TColStd_HArray1OfByte) GEOM_Engine
 
TCollection_AsciiString MakeCommandfor3DSketcher (const TCollection_AsciiString &theDescr)
 
static TCollection_AsciiString pack_data (const Handle(TColStd_HArray1OfByte)&aData)
 

Variables

static int MYDEBUG = 0
 
static GEOM_EngineTheEngine = NULL
 
return aRetSeq
 

Macro Definition Documentation

#define C_BRACKET   ')'
#define C_SQR_BRACKET   ']'
#define COMMA   ','
#define O_BRACKET   '('
#define O_SQR_BRACKET   '['
#define PY_NULL   "None"
#define TEXTURE_LABEL_DATA   5
#define TEXTURE_LABEL_FILE   2
#define TEXTURE_LABEL_HEIGHT   4
#define TEXTURE_LABEL_ID   1
#define TEXTURE_LABEL_WIDTH   3

Typedef Documentation

typedef std::map< int, std::list < int > > TIntToListIntMap
typedef std::map< TCollection_AsciiString, TObjectData > TSting2ObjDataMap
typedef std::map< TCollection_AsciiString, TObjectData* > TSting2ObjDataPtrMap
typedef std::map< TCollection_AsciiString, TCollection_AsciiString > TSting2StringMap

Function Documentation

void AddObjectColors ( int  theDocID,
TCollection_AsciiString &  theScript,
const TSting2ObjDataMap theEntry2ObjData 
)
void AddTextures ( int  theDocID,
TCollection_AsciiString &  theScript 
)
static TCollection_AsciiString BuildID ( Standard_Integer  theDocID,
const char *  theEntry 
)
static

References GEOM_Engine::theEntry.

static TCollection_AsciiString BuildIDFromObject ( Handle(GEOM_BaseObject)&  theObject)
static
static Standard_Integer ExtractDocID ( TCollection_AsciiString &  theID)
static
void FillMapOfRef ( const Handle(GEOM_Function)&  theFunction,
TIntToListIntMap theRefMap 
)
static

FillMapOfRef: Fill the map of references

References GEOM_Function::GetDependency(), GEOM_Function::GetOwnerEntry(), GetTag(), and Handle().

for ( ;it.  More);it.Next()

References aRetSeq, and it().

TCollection_AsciiString GetPublishCommands ( const int  theTag,
const std::map< int, TCollection_AsciiString > &  theEntryToCmdMap,
const TIntToListIntMap theMapRefs,
std::set< int > &  thePublished 
)
static

References aResult.

int GetTag ( const TCollection_AsciiString &  theEntry)
static

GetTag: Returns the tag from entry

Handle ( TColStd_HSequenceOfInteger  )

Find IDs of sub-shapes complying with given status about quadrangle.

Find sub-shapes complying with given status about surface.

FindEntries: Returns a sequence of start/end positions of entries in the string

GetSubShapeIndices

GetFreeFacesIDs

Parameters
theBox- the box to check state of sub-shapes against
theShape- the shape to explore
theShapeType- type of sub-shape of theShape
theState- required state
Return values
Handle(TColStd_HSequenceOfInteger)- IDs of found sub-shapes
Parameters
theCheckShape- the shape to check state of sub-shapes against
theShape- the shape to explore
theShapeType- type of sub-shape of theShape
theState- required state
Return values
Handle(TColStd_HSequenceOfInteger)- IDs of found sub-shapes
Parameters
theSurface- the surface to check state of sub-shapes against
theShape- the shape to explore
theShapeType- type of sub-shape of theShape
theState- required state
Return values
Handle(TColStd_HSequenceOfInteger)- IDs of found sub-shapes

getSubShapeEdgeSortedIDs

GetShapesOnPlaneIDs

GetShapesOnPlaneWithLocationIDs

GetShapesOnCylinderIDs

GetShapesOnCylinderWithLocationIDs

GetShapesOnSphereIDs

Parameters
theShape- the shape to explore
theShapeType- type of sub-shape of theShape
theTopLeftPoint- top left quadrangle corner
theTopRigthPoint- top right quadrangle corner
theBottomLeftPoint- bottom left quadrangle corner
theBottomRigthPoint- bottom right quadrangle corner
theState- required state
Return values
Handle(TColStd_HSequenceOfInteger)- IDs of found sub-shapes

References Handle().

Handle ( TDocStd_Document  )
Handle ( GEOM_Object  )

AddSubShape

References Handle().

Handle (TColStd_HSequenceOfAsciiString) GEOM_Engine Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString it ( _studyEntry2NameMap  )
TCollection_AsciiString MakeCommandfor3DSketcher ( const TCollection_AsciiString &  theDescr)

MakeCommandfor3DSketcher: Make new command for 3DSketcher

References aResult.

static TCollection_AsciiString pack_data ( const Handle(TColStd_HArray1OfByte)&  aData)
static
bool ProcessFunction ( Handle(GEOM_Function)&  theFunction,
TCollection_AsciiString &  theScript,
TCollection_AsciiString &  theAfterScript,
const TVariablesList theVariables,
const bool  theIsPublished,
TDF_LabelMap &  theProcessed,
std::set< TCollection_AsciiString > &  theIgnoreObjs,
bool &  theIsDumpCollected 
)
void PublishObject ( TObjectData theObjectData,
TSting2ObjDataMap theEntry2ObjData,
const TSting2ObjDataPtrMap theStEntry2ObjDataPtr,
Resource_DataMapOfAsciiStringAsciiString &  theNameToEntry,
std::map< int, TCollection_AsciiString > &  theEntryToCmdMap,
std::set< TCollection_AsciiString > &  theIgnoreMap 
)
void ReplaceEntriesByNames ( TCollection_AsciiString &  theScript,
TSting2ObjDataMap aEntry2ObjData,
const bool  theIsPublished,
TColStd_SequenceOfAsciiString &  theObjListToPublish,
Standard_Integer &  objectCounter,
Resource_DataMapOfAsciiStringAsciiString &  aNameToEntry 
)

ReplaceEntriesByNames: Replace object entries by their names

References TObjectData::_name, TObjectData::_pyName, GEOM_Engine::GetEngine(), Handle(), and GEOM_Engine::healPyName().

void ReplaceVariables ( TCollection_AsciiString &  theCommand,
const TVariablesList theVariables 
)

ReplaceVariables: Replace parameters of the function by variales from Notebook if need

References C_BRACKET, C_SQR_BRACKET, COMMA, ObjectStates::GetCurrectState(), ObjectStates::IncrementState(), it(), MYDEBUG, O_BRACKET, O_SQR_BRACKET, and PY_NULL.

Variable Documentation

return aRetSeq
int MYDEBUG = 0
static
GEOM_Engine* TheEngine = NULL
static