In the following subsections, for each use cases, we display the corresponding code sample and expected output.
The .stp file written was read with STEP File Analyzer from NIST (Version 5.31).
In the following subsections, for each use cases, we display the corresponding code sample and expected output.
The .stp file written, representing the assembly, was read with STEP File Analyzer from NIST (Version 5.31).
#ifdef WIN32
#include <windows.h>
#endif
{
namespace sample
{
{
axis->SetMatrix( trsf );
axis->SetName( "Axis_System" );
return axis;
}
{
}
{
layerInfosSet->SetLayerID(0, 42);
layerInfosSet->SetLayerID(1, 1900);
layerInfosSet->SetLayerID(2, 0);
layerInfosSet->SetLayerName(0, "MyFirstLayer");
layerInfosSet->SetLayerName(1, "MySecondLayer");
layerInfosSet->SetLayerName(2, "Faces");
return layerInfosSet;
}
{
}
{
}
{
}
{
}
{
};
{
mesh = listMesh[ 0 ];
}
{
{
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 );
}
}
{
{
int nodeid_Fdt1 = 42;
{
}
int userDefinedID_viewNode = 4242;
{
}
}
}
{
{
int datum_node_id = 42;
{
}
geometricalTolerance->Transform( fdt_transf );
int geometrical_tolerance_node_id = 43;
{
}
int viewModeThatReferencesAllFDTs = 1;
}
}
{
int userDefinedID_product = 42;
{
}
}
{
body1->get_info()->SetLayer(42);
body1->GetEntity( 10 )->info()->SetLayer( 0 );
body1->GetEntity( 20 )->info()->SetLayer( 0 );
body1->GetEntity( 30 )->info()->SetLayer( 0 );
body2->get_info()->SetLayer(1900);
body3->get_info()->SetLayer(1900);
}
{
int assignedID_leafPart = 0;
int assignedID_subProduct = 0;
{
}
{
int assignedID_rootProduct = 0;
}
}
{
int assignedID_leafPart = 0;
int assignedID_instance1 = 0, assignedID_instance2 = 0, assignedID_instance3 = 0;
int assignedID_subProduct = 0;
{
}
{
int assignedID_rootProduct = 0;
{
dimension->TransformationMatrix().setXdir(
Dtk_dir( 0., 1., 0. ) );
dimension->TransformationMatrix().setYdir(
Dtk_dir( -1., 0., 0. ) );
dimension->TransformationMatrix().setZdir(
Dtk_dir( 0., 0., 1. ) );
dimension->TransformationMatrix().setOrigin(
Dtk_pnt( 0., 0., -50. ) );
int userDefinedID_dimensionNode = 1002;
{
int targetedFaceID_1 = 10;
}
{
int targetedFaceID_2 = 10;
{
}
}
}
{
int viewModeThatReferencesAllFDTs = 1;
}
}
}
{
int assignedID_leafPart = 0;
int assignedID_subProduct = 0;
{
{
part_info->
AddAttribute(
"assembly validation property : : centre point", valprop_notional_CG );
prod_info->
AddAttribute(
"assembly validation property : : number of children", valprop_nbchildren );
}
}
{
int assignedID_rootProduct = 0;
instance_info->
AddAttribute(
"user defined attribute : : instance kind", instance_kind );
instance_info->
AddAttribute(
"attribute validation property : : text user attributes", instance_valprop );
}
}
{
int assignedID_leafPart = 0;
int assignedID_subProduct = 0;
{
}
{
int assignedID_rootProduct = 0;
}
}
{
int assignedID_leafPart = 0;
Dtk_string uniqueNameForProduct = L
"ExternalPartWithBody";
int assignedID_subProduct = 0;
{
}
{
int assignedID_rootProduct = 0;
}
}
{
int assignedID_leafPart = 0;
Dtk_string uniqueNameForLeafProduct = L
"NestedExternalPartWithBody";
int assignedID_subProduct = 0;
{
Dtk_string uniqueNameForSubProduct = L
"NestedExternalSubProduct";
}
{
int assignedID_rootProduct = 0;
}
}
{
int assignedID_leafPart;
Dtk_string uniqueNameForLeafProduct = L
"ExternalPartWithBody_ReferencedByFDT";
int assignedID_instance1 = 0, assignedID_instance2 = 0, assignedID_instance3 = 0, assignedID_instance4 = 0;
int userID_instance1 = 101, userID_instance2 = 102, userID_instance3 = 103, userID_instance4 = 104;
int assignedID_subProduct = 0;
{
}
{
int assignedID_rootProduct = 0;
int userDefinedID_dimensionNode = 42;
{
int targetedFaceID_1 = 73;
}
{
int targetedFaceID_2 = 105;
{
}
}
}
}
}
}
{
std::cout << endl << "----------------------------------------------" << std::endl;
std::cout << "Step Write start" << std::endl;
outputDirectory = inResultDirectory + L"Step/";
int codeForAP214 = 2;
int codeForAP242 = 4;
int dummy;
{
outputFileName = outputDirectory + L"SamplePart_BodyOnly.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_BodyWithAxisSystem.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_WireframeOnly.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_MeshOnly.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_MeshWithFaceColors.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_BodyAndMeshFromTessellation.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_WithProperties.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_BodyInNamedLayer.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_Datum.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_GeometricalTolerance.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SamplePart_UsedByExternalAssembly.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SampleAssembly.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SampleAssembly_DimensionFDT.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SampleAssembly_WithProperties.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SampleAssembly_InstanceAttributes.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SampleAssembly_BasicExternalReferences.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SampleAssembly_BasicExternalReference_DimensionFDT.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
{
outputFileName = outputDirectory + L"SampleAssembly_NestedExternalReferences.step";
std::cout <<
"=> " << outputFileName.
c_str() << std::endl;
}
std::cout << "Step Write end" << std::endl;
return 0;
}