DATAKIT API  V2025.1
testlibsatwrite.cpp File Reference

Functions

int SatWriteSample (const Dtk_string &inResultDirectory)
 

Function Documentation

◆ SatWriteSample()

int SatWriteSample ( const Dtk_string inResultDirectory)
16 {
17  Dtk_string outputFileName, outputDirectory;
18 
19  cout << endl << "----------------------------------------------" << endl;
20  cout << "Acis Write start" << endl;
21 
22  // Choosing output directory and file name
23  outputDirectory = inResultDirectory + L"dtk/Acis/";
24  outputDirectory.FixPathSeparator();
25  outputDirectory.mkdir();
26  outputFileName = outputDirectory + L"sample.sat";
27 
28  // First you have to initialize the Sat writer
29  int status = satw_InitFile( outputFileName );
30 
31  if( status )
32  {
33  cout << "error : " << dtkTypeError( status ).c_str() << endl;
34  return status;
35  }
36 
37  // We create 2 bodies
40 
41  // We init the part
42  satw_InitPart();
43 
44  // We write the 2 bodies
45  satw_WriteBody( body1 );
46  satw_WriteBody( body2 );
47 
48  // We close the part
49  satw_EndPart();
50 
51  // We free memory allocated for writing
52  satw_EndFile();
53  cout << "=> " << outputFileName.c_str() << endl;
54  cout << "Acis Write end" << endl;
55 
56  return 0;
57 }
satw_InitPart
DtkErrorStatus satw_InitPart()
Initializes the writing of a 3D part.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
satw_InitFile
DtkErrorStatus satw_InitFile(const Dtk_string &inFileOut, const satw_WriteOptions &inOptions=satw_WriteOptions())
Initializes a file to be written.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
dtkTypeError
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
Dtk_string::c_str
const char * c_str() const
Retrieve the ASCII conversion string.
Dtk_string::mkdir
int mkdir() const
File Utility : Create a Directory.
Dtk_string::FixPathSeparator
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
satw_EndPart
DtkErrorStatus satw_EndPart()
Ends the writing of a part.
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Definition: testcreatecube.cpp:1249
satw_WriteBody
DtkErrorStatus satw_WriteBody(const Dtk_BodyPtr &inBody)
Writes a Body.
sampleWriter::CreateOpenShell
void CreateOpenShell(std::map< Dtk_ID, Dtk_EntityPtr > &outArrayTopo, const Dtk_BodyPtr &inDtkBody)
Definition: testcreatecube.cpp:1194
satw_EndFile
DtkErrorStatus satw_EndFile()
Ends the writing of the Sat file.