 |
DATAKIT SDK
V2026.4
|
|
◆ PswGetLastOutputFile()
◆ PswGetLastStream()
| const Dtk_tab<char>& PswGetLastStream |
( |
| ) |
|
◆ PswGetOrWritePrototype()
123 if( inPrototype.
IsNULL() )
126 Dtk_ID compId = inPrototype->GetID();
134 Dtk_Size_t numChildren = inPrototype->GetNumChildren();
135 bool hasSubComponents = ( numChildren > 0 );
139 if( hasSubComponents )
155 cout <<
"Warning: component file missing for '"
156 << inPrototype->Name().c_str() <<
"'" << endl;
170 cout <<
"Warning: ReadComponent failed: " <<
dtkTypeError( err ).
c_str() << endl;
181 if( hasSubComponents )
184 if( bodyIds.
size() > 0 )
201 entityId = assemblyId;
205 if( bodyIds.
size() == 1 )
208 entityId = bodyIds[ 0 ];
216 else if( bodyIds.
size() > 1 )
233 entityId = assemblyId;
◆ PswWriteComponent()
252 if( inComponent.
IsNULL() )
266 if( protoEntityId == 0 )
276 Dtk_string instanceName = inComponent->InstanceName();
278 instanceName = inComponent->Name();
279 if( instanceName.
len() > 0 )
305 Dtk_Int32 defaultComponentIndex = inComponent->GetDefaultChildInCatalog();
308 Dtk_tab<Dtk_Int32> activatedComponentIndices = inComponent->GetActivatedChildrenInCatalog();
311 Dtk_Size_t numActivatedComponents = activatedComponentIndices.
size();
314 if( numActivatedComponents > 0 )
317 for(
Dtk_Size_t i = 0; i < numActivatedComponents; i++ )
320 Dtk_ComponentPtr activatedComponent = inComponent->GetChild( activatedComponentIndices[ i ] );
327 Dtk_ComponentPtr defaultChildComponent = inComponent->GetChild( defaultComponentIndex );
◆ PswWriteDocument()
354 if( rootComponent.
IsNULL() )
356 cout <<
"Warning: document has no root component." << endl;
361 Dtk_ID rootAssemblyId = 0;
366 if( docName.
len() > 0 )
◆ PswWriteEnd()
◆ PswWriteInit()
394 if( inOutputFolder.
len() > 0 )
395 outputFile = inOutputFolder + inInputFile.
filename() + inInputFile.
extension() + L
"_psw.x_t";
397 outputFile = inInputFile + L
"_psw.x_t";
406 cout <<
"Creating Parasolid file: " << outputFile.
c_str() << endl;
◆ PswWriteInitMemory()
429 cout <<
"Parasolid writer: using in-memory stream (no .x_t file)." << endl;
431 cout <<
"Warning: psw_InitFile (memory) failed: " <<
dtkTypeError( err ).
c_str() << endl;
◆ PswWriteNode()
47 int blanked = inNode->GetInfos()->GetBlankedStatus();
65 if( inNode->GetInfos()->GetInfiniteGeometryFlag() != 0 )
76 if( inNode->NodeHasSolids() || inNode->NodeHasSurfaces() )
79 cout <<
"Warning: skipping body node '" << inNode->Name().c_str() <<
"' because it has no solids or surfaces." << endl;
◆ g_lastOutputFile
◆ g_lastStream
◆ g_prototypeCache
static Dtk_SmartPtr< Dtk_Info > Create()
Calls default constructor to allocate a new object.
uint32_t Dtk_ID
Definition: define.h:688
Dtk_ErrorStatus psw_WriteMesh(Dtk_MeshPtr &inMesh, Dtk_tab< Dtk_ID > &outTabIds, Dtk_bool bExplode=DTK_FALSE)
Writes a Mesh of a 3D part.
static void PswWriteComponent(Dtk_ComponentPtr inComponent, Dtk_ID inParentAssemblyId)
Definition: WriteParasolid.cpp:250
void PswWriteNode(Dtk_NodePtr inNode, Dtk_tab< Dtk_ID > &outIds)
Definition: WriteParasolid.cpp:42
@ CatalogComponentType
Definition: dtk_maindoc.hpp:575
Dtk_ErrorStatus SetName(Dtk_string inName)
@ dtkErrorFileNotExist
Definition: error_dtk.hpp:103
DtkErrorStatus psw_InitFile(const Dtk_string &inFileOut, Dtk_bool muteMode, Dtk_Int32 inVersion=180)
Initialise a file to be written.
Dtk_bool IsNotNULL() const
Definition: util_ptr_dtk.hpp:119
NodeDataTypeEnum PrimaryType() const
Definition: dtk_maindoc.hpp:285
#define DTK_TRUE
Definition: define.h:726
DtkErrorStatus psw_LinkAttribut(Dtk_ID inAssemblyId)
link all attributes attached to an assembly
This is a high level string class.
Definition: dtk_string.hpp:53
size_t Dtk_Size_t
Definition: define.h:711
@ BodyType
Definition: dtk_maindoc.hpp:252
Dtk_ErrorStatus EndComponent(Dtk_ComponentPtr &inComponent)
EndComponent release data allocated by ReadComponent or ReadComponentGraphic. You have to call EndCom...
char Dtk_bool
Definition: define.h:724
@ VirtualComponentType
Definition: dtk_maindoc.hpp:576
@ InstanceComponentType
Definition: dtk_maindoc.hpp:573
static Dtk_string g_lastOutputFile
Definition: WriteParasolid.cpp:18
DtkErrorStatus psw_CreateAttribut(Dtk_ID inIdCompo, Dtk_InfoPtr &info)
Create all attribut attached to a component (body, assembly, instance)
void WriteBodyForParasolid(Dtk_BodyPtr inBody, Dtk_tab< Dtk_ID > &outIds)
Definition: WriteBodyForParasolid.cpp:12
static Dtk_API * GetAPI()
Get DATAKIT API.
Dtk_string filename() const
File Utility : Retrieves the filename in Dtk_string form.
static Dtk_SmartPtr< Dtk_transfo > Create()
Calls default constructor to allocate a new object.
int32_t Dtk_Int32
Definition: define.h:686
This is the Node FullType Class The Dtk_Node::FullType object is used to retrieve the full informatio...
Definition: dtk_maindoc.hpp:273
ComponentTypeEnum
Definition: dtk_maindoc.hpp:572
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_bool IsNULL() const
Definition: util_ptr_dtk.hpp:118
Definition: util_ptr_dtk.hpp:37
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
DtkErrorStatus psw_CreateInstance(Dtk_ID inAssemblyId, Dtk_ID inIdPart, Dtk_transfoPtr &Matrix, Dtk_ID &outIdInst)
Create an Instance item of a part referenced by inIdPart.
static map< Dtk_ID, Dtk_ID > g_prototypeCache
Definition: WriteParasolid.cpp:14
const char * c_str() const
Retrieve the ASCII conversion string.
Dtk_string extension() const
File Utility : Retrieves the extension in Dtk_string form.
This is a high level array class.
Definition: util_stl_dtk.hpp:84
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:503
static Dtk_ID PswGetOrWritePrototype(Dtk_ComponentPtr inPrototype)
Definition: WriteParasolid.cpp:121
@ PrototypeComponentType
Definition: dtk_maindoc.hpp:574
static Dtk_tab< char > g_lastStream
Definition: WriteParasolid.cpp:22
DtkErrorStatus psw_CreateEmptyAssembly(Dtk_ID &outAssemblyId)
Create the entry item of an assembly.
@ ComponentMissing
Definition: dtk_maindoc.hpp:562
int len() const
Retrieve the length of the Dtk_string.
DtkErrorStatus psw_EndFile(Dtk_tab< Dtk_ID > &inTabIds, Dtk_bool binForceListOfBody=DTK_FALSE)
Ends the writing of the Parasolid (x_t or x_b) file.
@ dtkNoError
Definition: error_dtk.hpp:151
void push_back(const T &x)
Inserts an element at the end of the array.
Definition: util_stl_dtk.hpp:416
void clear(int no_delete=0)
Resets the Dtk_tab content.
Definition: util_stl_dtk.hpp:352
Dtk_ErrorStatus ReadComponent(const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)
Read Component from Assembly Tree (Call EndComponent to free data allocated)
@ MeshType
Definition: dtk_maindoc.hpp:253
Definition: dtk_api.hpp:75