Go to the source code of this file.
◆ ActivatePsMemory()
| void ActivatePsMemory |
( |
bool |
inActivate | ) |
|
◆ ActivatePsSession()
| void ActivatePsSession |
( |
bool |
inActivate | ) |
|
◆ ActivatePsTraverse()
| void ActivatePsTraverse |
( |
bool |
inActivate | ) |
|
◆ EnumerateBodiesInSession()
| void EnumerateBodiesInSession |
( |
| ) |
|
149 PK_PARTITION_t partition = 0;
150 PK_SESSION_ask_curr_partition( &partition );
153 PK_BODY_t* bodies =
nullptr;
154 PK_PARTITION_ask_bodies( partition, &nBodies, &bodies );
155 cout <<
"Bodies in active partition: " << nBodies << endl;
157 for(
int i = 0; i < nBodies; ++i )
159 PK_BODY_t body = bodies[ i ];
161 PK_BODY_type_t bodyType = 0;
162 PK_BODY_ask_type( body, &bodyType );
165 PK_FACE_t* faces =
nullptr;
166 PK_ERROR_code_t fErr = PK_BODY_ask_faces( body, &nFaces, &faces );
168 const char* typeName =
"unknown";
169 if ( bodyType == PK_BODY_type_solid_c ) typeName =
"solid";
170 else if( bodyType == PK_BODY_type_sheet_c ) typeName =
"sheet";
171 else if( bodyType == PK_BODY_type_wire_c ) typeName =
"wire";
172 else if( bodyType == PK_BODY_type_acorn_c ) typeName =
"acorn";
173 else if( bodyType == PK_BODY_type_general_c ) typeName =
"general";
175 if( fErr == PK_ERROR_none )
177 cout <<
" Body[" << i <<
"] tag=" << body
178 <<
" type=" << typeName
179 <<
" faces=" << nFaces << endl;
180 if( faces ) PK_MEMORY_free( faces );
184 cout <<
" Body[" << i <<
"] tag=" << body
185 <<
" type=" << typeName
186 <<
" PK_BODY_ask_faces error=" << fErr << endl;
190 if( bodies ) PK_MEMORY_free( bodies );
◆ IsPsMemoryActivated()
| bool IsPsMemoryActivated |
( |
| ) |
|
◆ IsPsSessionActivated()
| bool IsPsSessionActivated |
( |
| ) |
|
◆ IsPsTraverseActivated()
| bool IsPsTraverseActivated |
( |
| ) |
|
◆ LoadAssemblyIntoPsSession()
| void LoadAssemblyIntoPsSession |
( |
const Dtk_string & |
inInputFile | ) |
|
◆ LoadBodiesIntoPsSession()
| void LoadBodiesIntoPsSession |
( |
const Dtk_string & |
inXtFile | ) |
|
200 cout <<
"\n--- Parasolid session: loading \""
201 << inXtFile.
c_str() <<
"\" from disk ---" << endl;
206 PK_PART_receive_o_t recvOpts;
207 PK_PART_receive_o_m( recvOpts );
210 PK_PART_t* parts =
nullptr;
211 PK_ERROR_code_t pkErr = PK_PART_receive(
212 inXtFile.
c_str(), &recvOpts, &nParts, &parts );
214 if( pkErr != PK_ERROR_none )
216 cout <<
"PK_PART_receive failed, error code: " << pkErr << endl;
220 cout <<
"PK_PART_receive: " << nParts <<
" part(s) received." << endl;
224 if( parts ) PK_MEMORY_free( parts );
227 cout <<
"--- Parasolid session closed ---" << endl;
◆ LoadBodiesIntoPsSessionFromStream()
| void LoadBodiesIntoPsSessionFromStream |
( |
const Dtk_tab< char > & |
inStream | ) |
|
238 if( inStream.
size() == 0 )
240 cout <<
"Warning: in-memory stream is empty, nothing to load." << endl;
244 cout <<
"\n--- Parasolid session: loading "
245 << inStream.
size() <<
" bytes from in-memory stream ---" << endl;
251 PK_MEMORY_block_t block;
252 block.next =
nullptr;
253 block.n_bytes =
static_cast<size_t>( inStream.
size() );
254 block.bytes = &inStream[ 0 ];
256 PK_PART_receive_o_t recvOpts;
257 PK_PART_receive_o_m( recvOpts );
260 PK_PART_t* parts =
nullptr;
261 PK_ERROR_code_t pkErr = PK_PART_receive_b( block, &recvOpts, &nParts, &parts );
263 if( pkErr != PK_ERROR_none )
265 cout <<
"PK_PART_receive_b failed, error code: " << pkErr << endl;
269 cout <<
"PK_PART_receive_b: " << nParts <<
" part(s) received." << endl;
273 if( parts ) PK_MEMORY_free( parts );
276 cout <<
"--- Parasolid session closed ---" << endl;
◆ ReceiveBodiesIntoCurrentPsSession()
| void ReceiveBodiesIntoCurrentPsSession |
( |
const Dtk_string & |
inXtFile | ) |
|
292 cout <<
"\n--- Receiving \""
294 <<
"\" into existing Parasolid session ---" << endl;
296 PK_PART_receive_o_t recvOpts;
297 PK_PART_receive_o_m( recvOpts );
300 PK_PART_t* parts =
nullptr;
301 PK_ERROR_code_t pkErr = PK_PART_receive(
302 inXtFile.
c_str(), &recvOpts, &nParts, &parts );
304 if( pkErr != PK_ERROR_none )
306 cout <<
"PK_PART_receive failed, error code: " << pkErr << endl;
309 cout <<
"PK_PART_receive: " << nParts <<
" part(s) received." << endl;
311 if( parts ) PK_MEMORY_free( parts );
◆ ReceiveBodiesIntoCurrentPsSessionFromStream()
| void ReceiveBodiesIntoCurrentPsSessionFromStream |
( |
const Dtk_tab< char > & |
inStream | ) |
|
321 if( inStream.
size() == 0 )
323 cout <<
"Warning: in-memory stream is empty, nothing to receive." << endl;
327 cout <<
"\n--- Receiving "
329 <<
" bytes from in-memory stream into existing Parasolid session ---" << endl;
331 PK_MEMORY_block_t block;
332 block.next =
nullptr;
333 block.n_bytes =
static_cast<size_t>( inStream.
size() );
334 block.bytes = &inStream[ 0 ];
336 PK_PART_receive_o_t recvOpts;
337 PK_PART_receive_o_m( recvOpts );
340 PK_PART_t* parts =
nullptr;
341 PK_ERROR_code_t pkErr = PK_PART_receive_b( block, &recvOpts, &nParts, &parts );
343 if( pkErr != PK_ERROR_none )
345 cout <<
"PK_PART_receive_b failed, error code: " << pkErr << endl;
348 cout <<
"PK_PART_receive_b: " << nParts <<
" part(s) received." << endl;
350 if( parts ) PK_MEMORY_free( parts );
◆ StartSharedPsSession()
| void StartSharedPsSession |
( |
| ) |
|
◆ StopSharedPsSession()
| void StopSharedPsSession |
( |
| ) |
|