DATAKIT SDK  V2026.1
testlibsatwrite.cpp File Reference

Functions

int SatWriteSample (const Dtk_string &inResultDirectory)
 

Function Documentation

◆ SatWriteSample()

int SatWriteSample ( const Dtk_string inResultDirectory)
12 {
13  Dtk_string outputFileName, outputDirectory;
14 
15  cout << endl << "----------------------------------------------" << endl;
16  cout << "Acis Write start" << endl;
17 
18  // Choosing output directory and file name
19  outputDirectory = inResultDirectory + L"Acis/";
20  outputDirectory.FixPathSeparator();
21  outputDirectory.mkdir();
22  outputFileName = outputDirectory + L"sample.sat";
23 
24  // First you have to initialize the Sat writer
25  int status = satw_InitFile( outputFileName );
26 
27  if( status )
28  {
29  cout << "error : " << dtkTypeError( status ).c_str() << endl;
30  return status;
31  }
32 
33  // We create 2 bodies
36 
37  // We init the part
38  satw_InitPart();
39 
40  // We write the 2 bodies
41  satw_WriteBody( body1 );
42  satw_WriteBody( body2 );
43 
44  // We close the part
45  satw_EndPart();
46 
47  // We free memory allocated for writing
48  satw_EndFile();
49  cout << "=> " << outputFileName.c_str() << endl;
50  cout << "Acis Write end" << endl;
51 
52  return 0;
53 }
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:53
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:1316
satw_WriteBody
DtkErrorStatus satw_WriteBody(const Dtk_BodyPtr &inBody)
Writes a Body.
sampleWriter::CreateOpenShell
Dtk_BodyPtr CreateOpenShell()
Definition: testcreatecube.cpp:1343
satw_EndFile
DtkErrorStatus satw_EndFile()
Ends the writing of the Sat file.