Version: 9.12.0
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 "utilities.h"
#include <Basics_Utils.hxx>
#include <Basics_OCCTVersion.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 <BinDrivers.hxx>
#include <StdDrivers_DocumentRetrievalDriver.hxx>
#include <PCDM_StorageDriver.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, TObjectDataTSting2ObjDataMap
 
typedef std::map< TCollection_AsciiString, TObjectData * > TSting2ObjDataPtrMap
 
typedef std::map< int, std::list< int > > TIntToListIntMap
 

Functions

static TCollection_AsciiString BuildIDFromObject (Handle(GEOM_BaseObject)&theObject)
 
bool ProcessFunction (Handle(GEOM_Function)&theFunction, TCollection_AsciiString &theScript, TCollection_AsciiString &theAfterScript, const TVariablesList &theVariables, const bool, 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)
 
void ReplaceEntriesByNames (TCollection_AsciiString &theScript, TSting2ObjDataMap &aEntry2ObjData, const bool theIsPublished, TColStd_SequenceOfAsciiString &theObjListToPublish, Standard_Integer &objectCounter, Resource_DataMapOfAsciiStringAsciiString &aNameToEntry)
 
void AddObjectColors (TCollection_AsciiString &theScript, const TSting2ObjDataMap &theEntry2ObjData)
 
void AddTextures (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...
 
void Prettify (TCollection_AsciiString &theScript)
 
 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
 
 Handle (TColStd_HArray1OfByte) GEOM_Engine
 
TCollection_AsciiString MakeCommandfor3DSketcher (const TCollection_AsciiString &theDescr)
 
static TCollection_AsciiString pack_data (const Handle(TColStd_HArray1OfByte)&aData)
 

Variables

static GEOM_EngineTheEngine = NULL
 

Macro Definition Documentation

◆ C_BRACKET

#define C_BRACKET   ')'

◆ C_SQR_BRACKET

#define C_SQR_BRACKET   ']'

◆ COMMA

#define COMMA   ','

◆ O_BRACKET

#define O_BRACKET   '('

◆ O_SQR_BRACKET

#define O_SQR_BRACKET   '['

◆ PY_NULL

#define PY_NULL   "None"

◆ TEXTURE_LABEL_DATA

#define TEXTURE_LABEL_DATA   5

◆ TEXTURE_LABEL_FILE

#define TEXTURE_LABEL_FILE   2

◆ TEXTURE_LABEL_HEIGHT

#define TEXTURE_LABEL_HEIGHT   4

◆ TEXTURE_LABEL_ID

#define TEXTURE_LABEL_ID   1

◆ TEXTURE_LABEL_WIDTH

#define TEXTURE_LABEL_WIDTH   3

Typedef Documentation

◆ TIntToListIntMap

typedef std::map< int, std::list < int > > TIntToListIntMap

◆ TSting2ObjDataMap

typedef std::map< TCollection_AsciiString, TObjectData > TSting2ObjDataMap

◆ TSting2ObjDataPtrMap

typedef std::map< TCollection_AsciiString, TObjectData* > TSting2ObjDataPtrMap

◆ TSting2StringMap

typedef std::map< TCollection_AsciiString, TCollection_AsciiString > TSting2StringMap

Function Documentation

◆ AddObjectColors()

void AddObjectColors ( TCollection_AsciiString &  theScript,
const TSting2ObjDataMap theEntry2ObjData 
)

AddObjectColors: Add color to objects

References GEOM::Color, GEOM_Engine::GetEngine(), and Handle().

◆ AddTextures()

void AddTextures ( TCollection_AsciiString &  theScript)

◆ BuildIDFromObject()

static TCollection_AsciiString BuildIDFromObject ( Handle(GEOM_BaseObject)&  theObject)
static

◆ FillMapOfRef()

void FillMapOfRef ( const Handle(GEOM_Function) &  theFunction,
TIntToListIntMap theRefMap 
)
static

FillMapOfRef: Fill the map of references

References GetTag(), and Handle().

◆ GetPublishCommands()

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

References aResult.

◆ GetTag()

int GetTag ( const TCollection_AsciiString &  theEntry)
static

GetTag: Returns the tag from entry

◆ Handle() [1/6]

◆ Handle() [2/6]

Handle ( GEOM_Object  )

AddSubShape

References GEOM_Engine::Handle().

◆ Handle() [3/6]

◆ Handle() [4/6]

Handle ( TColStd_HSequenceOfAsciiString  )

◆ Handle() [5/6]

Handle ( TColStd_HSequenceOfInteger  ) &

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

◆ Handle() [6/6]

Handle ( TDocStd_Document  )

◆ MakeCommandfor3DSketcher()

TCollection_AsciiString MakeCommandfor3DSketcher ( const TCollection_AsciiString &  theDescr)

MakeCommandfor3DSketcher: Make new command for 3DSketcher

References aResult.

◆ pack_data()

static TCollection_AsciiString pack_data ( const Handle(TColStd_HArray1OfByte)&  aData)
static

◆ Prettify()

void Prettify ( TCollection_AsciiString &  theScript)

◆ ProcessFunction()

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 
)

ProcessFunction: Dump function description into script

References Sketcher_Profile::GetDump(), Handle(), MakeCommandfor3DSketcher(), and ReplaceVariables().

◆ PublishObject()

void PublishObject ( TObjectData theObjectData,
TSting2ObjDataMap theEntry2ObjData,
const TSting2ObjDataPtrMap theStEntry2ObjDataPtr,
Resource_DataMapOfAsciiStringAsciiString &  theNameToEntry,
std::map< int, TCollection_AsciiString > &  theEntryToCmdMap,
std::set< TCollection_AsciiString > &  theIgnoreMap 
)

◆ ReplaceEntriesByNames()

void ReplaceEntriesByNames ( TCollection_AsciiString &  theScript,
TSting2ObjDataMap aEntry2ObjData,
const bool  ,
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().

◆ ReplaceVariables()

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(), O_BRACKET, O_SQR_BRACKET, and PY_NULL.

Variable Documentation

◆ TheEngine

GEOM_Engine* TheEngine = NULL
static