![Logo](tetiere_ht.jpg) |
DATAKIT API
V2025.1
|
|
#ifdef WIN32
#include <windows.h>
#endif
{
double scale = 1.;
double angle = 45.;
double viewdist = 50.;
return view;
}
{
axis->SetMatrix( trsf );
axis->SetName( "Axis_System" );
return axis;
}
{
int PartID;
return PartID;
if( ifdt == 2 )
{
int geomid1 = 73;
int geomid2 = 33;
}
Dtk_Val valprop_area(
"1234 mm2" );
part_info->
AddAttribute(
"geometric validation property : : surface area measure", valprop_area );
Dtk_Val valprop_volume(
"5678 mm3" );
part_info->
AddAttribute(
"geometric validation property : : volume measure", valprop_volume );
part_info->
AddAttribute(
"geometric validation property : : centre point", valprop_CG );
prod_info->
AddAttribute(
"material property : material name : Steel", mat_name );
Dtk_Val mat_density(
"7.89 g/cm3" );
prod_info->
AddAttribute(
"material property : density : density measure", mat_density );
if( ifdt == 1 )
{
int nodeid_Fdt1 = 1001;
int geomid1 = 73;
int nodeid_View1 = 2001;
}
return PartID;
}
{
int PartID;
return PartID;
Dtk_Val valprop_area(
"1234 mm2" );
part_info->
AddAttribute(
"geometric validation property : : surface area measure", valprop_area );
Dtk_Val valprop_volume(
"5678 mm3" );
part_info->
AddAttribute(
"geometric validation property : : volume measure", valprop_volume );
part_info->
AddAttribute(
"geometric validation property : : centre point", valprop_CG );
return PartID;
}
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
int ProdID, ProdID2;
status =
stepw_AddInstance( ProdID2, PartID, TransformationMatrix0,
"PartInstance" );
part_info->
AddAttribute(
"assembly validation property : : centre point", valprop_notional_CG );
prod_info->
AddAttribute(
"assembly validation property : : number of children", valprop_nbchildren );
instance_info->
AddAttribute(
"user defined attribute : : instance kind", instance_kind );
instance_info->
AddAttribute(
"attribute validation property : : text user attributes", instance_valprop );
status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1" );
status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2" );
}
void WriteAsmExt(
const int level,
const int asm_only )
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
int PartID;
if( !asm_only || level == 0 )
int ProdID, ProdID2;
status =
stepw_AddInstance( ProdID2, PartID, TransformationMatrix0,
"PartInstance" );
part_info->
AddAttribute(
"assembly validation property : : centre point", valprop_notional_CG );
prod_info->
AddAttribute(
"assembly validation property : : number of children", valprop_nbchildren );
instance_info->
AddAttribute(
"user defined attribute : : instance kind", instance_kind );
instance_info->
AddAttribute(
"attribute validation property : : text user attributes", instance_valprop );
status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1" );
status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2" );
}
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
int PartID;
int ProdID, ProdID2;
int InstID1, InstID2, InstID3, InstID4;
int UserInstID1 = 1, UserInstID2 = 2, UserInstID3 = 3, UserInstID4 = 4;
status =
stepw_AddInstanceWithInfo( ProdID2, PartID, TransformationMatrix0,
"PartInstance", instance_info, InstID1, UserInstID1,
"RD1" );
status =
stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0,
"PartInstance", instance_info, InstID2, UserInstID2,
"RD2" );
status =
stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1", instance_info, InstID3, UserInstID3,
"RD3" );
status =
stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2", instance_info, InstID4, UserInstID4,
"RD4" );
int nodeid_fdtasm = 1002;
int geomid1 = 73;
int geomid2 = 33;
}
int
{
cout << endl << "----------------------------------------------" << endl;
cout << "Step Write start" << endl;
outputDirectory = inResultDirectory + L"dtk/Step/";
outputFileName = outputDirectory + L"RootProduct.step";
if( status )
{
return status;
}
cout <<
"=> " << outputFileName.
c_str() << endl;
cout << "Step Write end" << endl;
return 0;
}
{
int PartID;
return PartID;
if( ifdt == 2 )
{
int geomid1 = 73;
int geomid2 = 33;
}
Dtk_Val valprop_area(
"1234 mm2" );
part_info->
AddAttribute(
"geometric validation property : : surface area measure", valprop_area );
Dtk_Val valprop_volume(
"5678 mm3" );
part_info->
AddAttribute(
"geometric validation property : : volume measure", valprop_volume );
part_info->
AddAttribute(
"geometric validation property : : centre point", valprop_CG );
prod_info->
AddAttribute(
"material property : material name : Steel", mat_name );
Dtk_Val mat_density(
"7.89 g/cm3" );
prod_info->
AddAttribute(
"material property : density : density measure", mat_density );
if( ifdt == 1 )
{
int nodeid_Fdt1 = 1001;
int geomid1 = 73;
int nodeid_View1 = 2001;
}
return PartID;
}
{
int PartID;
return PartID;
Dtk_Val valprop_area(
"1234 mm2" );
part_info->
AddAttribute(
"geometric validation property : : surface area measure", valprop_area );
Dtk_Val valprop_volume(
"5678 mm3" );
part_info->
AddAttribute(
"geometric validation property : : volume measure", valprop_volume );
part_info->
AddAttribute(
"geometric validation property : : centre point", valprop_CG );
return PartID;
}
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
int ProdID, ProdID2;
status =
stepw_AddInstance( ProdID2, PartID, TransformationMatrix0,
"PartInstance" );
part_info->
AddAttribute(
"assembly validation property : : centre point", valprop_notional_CG );
prod_info->
AddAttribute(
"assembly validation property : : number of children", valprop_nbchildren );
instance_info->
AddAttribute(
"user defined attribute : : instance kind", instance_kind );
instance_info->
AddAttribute(
"attribute validation property : : text user attributes", instance_valprop );
status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1" );
status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2" );
}
void WriteAsmExt(
const int level,
const int asm_only )
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
int PartID;
if( !asm_only || level == 0 )
int ProdID, ProdID2;
status =
stepw_AddInstance( ProdID2, PartID, TransformationMatrix0,
"PartInstance" );
part_info->
AddAttribute(
"assembly validation property : : centre point", valprop_notional_CG );
prod_info->
AddAttribute(
"assembly validation property : : number of children", valprop_nbchildren );
instance_info->
AddAttribute(
"user defined attribute : : instance kind", instance_kind );
instance_info->
AddAttribute(
"attribute validation property : : text user attributes", instance_valprop );
status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1" );
status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2" );
}
{
int status = 0;
Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
int PartID;
int ProdID, ProdID2;
int InstID1, InstID2, InstID3, InstID4;
int UserInstID1 = 1, UserInstID2 = 2, UserInstID3 = 3, UserInstID4 = 4;
status =
stepw_AddInstanceWithInfo( ProdID2, PartID, TransformationMatrix0,
"PartInstance", instance_info, InstID1, UserInstID1,
"RD1" );
status =
stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0,
"PartInstance", instance_info, InstID2, UserInstID2,
"RD2" );
status =
stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1", instance_info, InstID3, UserInstID3,
"RD3" );
status =
stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2", instance_info, InstID4, UserInstID4,
"RD4" );
int nodeid_fdtasm = 1002;
int geomid1 = 73;
int geomid2 = 33;
}
int
{
cout << endl << "----------------------------------------------" << endl;
cout << "Step Write start" << endl;
outputDirectory = inResultDirectory + L"dtk/Step/";
outputFileName = outputDirectory + L"RootProduct.step";
if( status )
{
return status;
}
cout <<
"=> " << outputFileName.
c_str() << endl;
cout << "Step Write end" << endl;
return 0;
}
static Dtk_ModelDisplayPtr Create(const Dtk_CameraPtr &inCamera, const Dtk_EntityPtr &inClippingEntity, const Dtk_bool inIsActivated)
Full featured constructor.
DtkErrorStatus stepw_AddInstanceWithInfo(const int inIDfather, const int inIDchild, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName, const Dtk_InfoPtr &inInstanceInfo)
Adds an instance of a sub-component (child) in a product (father : assembly node)
Dtk_BodyPtr CreateCube_2()
Definition: testcreatecylfdt.cpp:1092
DtkErrorStatus stepw_CreateReference(stepw_ER &ER, const int inEntityID)
int init_file_to_read(char *filename)
DtkErrorStatus stepw_AddInstance(const int inIDfather, const int inIDchild, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName)
Adds an instance of a sub-component (child) in a product (father : assembly node)
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_BodyPtr CreateCurves_2()
Definition: testcreatecylfdt.cpp:1138
Dtk_ErrorStatus AddAttribute(Dtk_string name, Dtk_Val val)
Dtk_ErrorStatus SetName(Dtk_string inName)
DtkErrorStatus stepw_Init3DPart(const int inID)
Initialise the writing of a 3D part : the own 3D part of a product (NOT its sub-components if any !...
DtkErrorStatus stepw_SetReferencePath(stepw_ER &ER, stepw_ERP &ERP)
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
ProjectionTypeEnum
Definition: util_draw_dtk.hpp:7866
#define DTK_TRUE
Definition: define.h:727
DtkErrorStatus stepw_Write3DConstructionGeometry(const Dtk_BodyPtr &inBody)
Writes a Body as a Construction Geometry of a 3D part, of any kind (solid, shell / faces,...
Definition: stepw.hpp:394
DtkErrorStatus stepw_SetModeFdt(const int inMode, const int inPolyline=0)
Activates/Deactivates writing of FDT (ignored if product Step3dWriteFdt is not present)
This is a high level string class.
Definition: dtk_string.hpp:58
static Dtk_SmartPtr< Dtk_AxisSystem > create()
DtkErrorStatus stepw_InitProduct(const Dtk_string &inProductName, int &outID, Dtk_ID inCompID=0)
Initialise the writing of a product (assembly node and/or part with 3D bodies)
int WritePartCyl(const Dtk_string &inReferenceName, const int itessel)
Definition: testlibstepwrite.cpp:204
DtkErrorStatus stepw_AddReference(stepw_ER &ER)
DtkErrorStatus stepw_Write3DPartBody(const Dtk_BodyPtr &inBody)
Writes a Body of a 3D part (3D content of a product), of any kind (solid, shell / faces,...
DtkErrorStatus stepw_SetAnchorProduct(const int stepw_ID, const int user_ID)
DtkErrorStatus stepw_EndProduct(const int inID)
Ends the writing of a product - calls WriteAssemblyInstances if not yet done.
DtkErrorStatus stepw_SetModeProp(const int inMode)
Activates/Deactivates writing of Properties : User Attributes, Product Data.
const Dtk_dir & getZdir() const
Return the Z vector.
Definition: dtk_val.hpp:67
Dtk_ErrorStatus stepw_Add3DPartProperty(const Dtk_MetaDataPtr &inProperty)
Commands to write a Property to a Part (at the level of the whole Part) by default,...
const Dtk_string & inReferenceName
Definition: catiav5w.hpp:456
DtkErrorStatus stepw_CreateInstancePath(stepw_ERP &ERP)
Dtk_FdtPtr CreateFdtDimAssy()
PMI in Assembly : a dimension between faces of different instances.
Definition: testcreatefdt.cpp:118
Dtk_ErrorStatus stepw_AddExternalReference(const Dtk_string &inProductName, const Dtk_string &inFileName, int &outID, Dtk_ID inInstCompId=0)
Declares a product to be written as external reference.
Dtk_FdtPtr CreateFdtDatum()
Create Simple Datum.
Definition: testcreatefdt.cpp:19
DtkErrorStatus stepw_CreateReferenceToNode(stepw_ER &ER, const int inNodeID, const int inProductID, const char *inRefKind="")
DtkErrorStatus stepw_Add3DPartFDT(const Dtk_FdtPtr &inFDT)
Commands to write a FDT of a 3D Part.
void close_file_to_read()
static Dtk_SmartPtr< Dtk_Entity > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
Dtk_bool IsNULL() const
Definition: util_ptr_dtk.hpp:118
Dtk_BodyPtr CreateConstructionPlane()
Definition: testcreatecylfdt.cpp:1185
@ ProjectionTypeParallel
Definition: util_draw_dtk.hpp:7868
DtkErrorStatus stepw_SetPartProperties(const Dtk_InfoPtr &inInfo, const int inItem)
Defines properties to be attached directly to the component : considers the list of Dtk_Val in the Dt...
Definition: util_ptr_dtk.hpp:37
DtkErrorStatus stepw_EndFile()
Ends the writing of the STEP file.
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
DtkErrorStatus stepw_End3DPart()
Ends the writing of a part : the own 3D part of a product + product definition.
DtkErrorStatus stepw_Write3DAxisSystem(const Dtk_AxisSystemPtr &inAxis)
Writes an Axis System of a 3D part - in STEP it is a construction geometry based on an axis placement...
const char * c_str() const
Retrieve the ASCII conversion string.
Dtk_AxisSystemPtr CreateAxisSystem()
Definition: testlibstepwrite.cpp:80
int WritePart(const Dtk_string &inReferenceName, const int ifdt)
Definition: testlibstepwrite.cpp:95
int mkdir() const
File Utility : Create a Directory.
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
Dtk_ErrorStatus stepw_Add3DModelDisplay(const Dtk_ModelDisplayPtr &inModelDisplay, const int inMode)
Commands to write a Model Display (type Dtk_ModelDisplay) in a 3d Part.
Dtk_ErrorStatus stepw_AddAnchorItem(const int inEntityID, const int inProductID, const Dtk_string &inGUID)
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
DtkErrorStatus stepw_InitFile(const Dtk_string &inFileOut, const char *Origin=" user ", const int StepSchema=0)
Initialise a file to be written.
static Dtk_CameraPtr Create()
Base constructor.
Definition: stepw.hpp:387
DtkErrorStatus stepw_AddInstanceToPath(stepw_ERP &ERP, const int inInstanceID)
const Dtk_dir & getYdir() const
Return the Y vector.
Dtk_ModelDisplayPtr CreateView()
Definition: testlibstepwrite.cpp:39
Dtk_BodyPtr CreateCylinder()
Definition: testcreatecylfdt.cpp:1211
void WriteAsm()
Definition: testlibstepwrite.cpp:270
void WriteAsmExt(const int level, const int asm_only)
Definition: testlibstepwrite.cpp:346
int StepWriteSample(const Dtk_string &inResultDirectory)
Definition: testlibstepwrite.cpp:528
static Dtk_SmartPtr< Dtk_Info > create()
void stepw_InitNodeContext(const int inNodeID)
Initialises the context to write items in a node of the model (internal model tree,...
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
void stepw_EndNodeContext(const int inNodeID=0)
void WriteAsmFdt(const int level)
Definition: testlibstepwrite.cpp:429