KiCad PCB EDA Suite
Loading...
Searching...
No Matches
U3D::WRITER Class Reference

#include <writer.h>

Public Member Functions

 WRITER (const std::string &aFilename)
 
bool Perform (const Handle(TDocStd_Document) &aDocument)
 
const VECTOR3DGetCenter () const
 
const Bnd_Box & GetMeshBoundingBox () const
 

Private Member Functions

void writeMatrix (BIT_STREAM_WRITER &aBitStreamWriter, const std::vector< float > &aMat)
 
std::shared_ptr< DATA_BLOCKgetGroupNodeBlock (const std::string &aGroupNodeName, const PARENT_NODE *aParentNode)
 
std::shared_ptr< DATA_BLOCKgetModelNodeBlock (const std::string &aModelNodeName, const std::string &aParentNodeName, const std::string &aModelResourceName, const std::vector< float > &aMat)
 
std::shared_ptr< DATA_BLOCKgetShadingModifierBlock (const std::string &aShadingModName, const std::string &aShaderName)
 
std::shared_ptr< DATA_BLOCKgetNodeModifierChain (const std::string &aModifierChainName, const std::string &aModelNodeName, const std::string &aParentNodeName, const std::string &aModelResourceName, const std::string &aShaderName, const std::vector< float > &aMat)
 
std::shared_ptr< DATA_BLOCKgetHeaderBlock (uint32_t aDeclSize, uint32_t aContSize)
 
std::shared_ptr< DATA_BLOCKgetLitTextureShaderBlock (const std::string &aShaderName, const std::string &aMaterialName)
 
std::shared_ptr< DATA_BLOCKgetMaterialResourceBlock (const std::string &aMaterialName, const Graphic3d_Vec4 &aDiffuseColor, const Graphic3d_Vec3 &aSpecularColor)
 
std::shared_ptr< DATA_BLOCKgetModelResourceModifierChain (const std::string &aModifierChainName, const MESH *aMesh, const std::string &aMeshname)
 
std::shared_ptr< DATA_BLOCKgetMeshDeclarationBlock (const MESH *aMesh, const std::string &aMeshName)
 
std::shared_ptr< DATA_BLOCKgetMeshContinuationBlock (const MESH *aMesh, const std::string &aMeshName)
 
std::shared_ptr< DATA_BLOCKgetLightModifierChain (const std::string &aModifierChainName, const std::string &aLightResourceName)
 
std::shared_ptr< DATA_BLOCKgetLightNodeBlock (const std::string &aLightNodeName, const std::string &aLightResourceName)
 
std::shared_ptr< DATA_BLOCKgetLightResourceBlock (const std::string &aLightResourceName)
 
std::shared_ptr< DATA_BLOCKgetGroupNodeModifierChain (const std::string &aModifierChainName, const std::vector< GROUP_NODE > &aGroupNodes)
 
uint32_t writeDataBlock (std::shared_ptr< DATA_BLOCK > b, wxMemoryOutputStream &aStream)
 
void generateMeshesByAssembly (const Handle(TDocStd_Document) &doc)
 
void collectGeometryRecursive (const TDF_Label &label, const Handle(XCAFDoc_ShapeTool) &shapeTool, const Handle(XCAFDoc_ColorTool) &colorTool, const Handle(XCAFDoc_VisMaterialTool) &visMatTool, const gp_Trsf &cumulativeTransform, const std::string &baseName, std::unordered_map< Graphic3d_Vec4, MESH * > &meshesByColor)
 
void getMeshName (const TDF_Label &label, Handle(XCAFDoc_ShapeTool) shapeTool, MESH *mesh)
 

Private Attributes

std::string m_filename
 
VECTOR3D m_center
 
Bnd_Box m_meshBoundingBox
 
std::map< std::string, int > m_meshDedupMap
 
const uint32_t m_contextBaseShadingID = 1
 
bool m_includeNormals
 
std::vector< std::unique_ptr< MESH > > m_meshes
 
std::vector< GROUP_NODEm_groupNodes
 

Detailed Description

Definition at line 202 of file writer.h.

Constructor & Destructor Documentation

◆ WRITER()

WRITER::WRITER ( const std::string & aFilename)

Definition at line 524 of file writer.cpp.

References m_center, m_filename, m_includeNormals, m_meshBoundingBox, and m_meshDedupMap.

Member Function Documentation

◆ collectGeometryRecursive()

void WRITER::collectGeometryRecursive ( const TDF_Label & label,
const Handle(XCAFDoc_ShapeTool) & shapeTool,
const Handle(XCAFDoc_ColorTool) & colorTool,
const Handle(XCAFDoc_VisMaterialTool) & visMatTool,
const gp_Trsf & cumulativeTransform,
const std::string & baseName,
std::unordered_map< Graphic3d_Vec4, MESH * > & meshesByColor )
private

◆ generateMeshesByAssembly()

◆ GetCenter()

const VECTOR3D & U3D::WRITER::GetCenter ( ) const
inline

Definition at line 209 of file writer.h.

References m_center.

Referenced by STEP_PCB_MODEL::WritePDF().

◆ getGroupNodeBlock()

std::shared_ptr< DATA_BLOCK > WRITER::getGroupNodeBlock ( const std::string & aGroupNodeName,
const PARENT_NODE * aParentNode )
private

◆ getGroupNodeModifierChain()

std::shared_ptr< DATA_BLOCK > WRITER::getGroupNodeModifierChain ( const std::string & aModifierChainName,
const std::vector< GROUP_NODE > & aGroupNodes )
private

◆ getHeaderBlock()

◆ getLightModifierChain()

std::shared_ptr< DATA_BLOCK > WRITER::getLightModifierChain ( const std::string & aModifierChainName,
const std::string & aLightResourceName )
private

◆ getLightNodeBlock()

std::shared_ptr< DATA_BLOCK > WRITER::getLightNodeBlock ( const std::string & aLightNodeName,
const std::string & aLightResourceName )
private

◆ getLightResourceBlock()

std::shared_ptr< DATA_BLOCK > WRITER::getLightResourceBlock ( const std::string & aLightResourceName)
private

◆ getLitTextureShaderBlock()

std::shared_ptr< DATA_BLOCK > WRITER::getLitTextureShaderBlock ( const std::string & aShaderName,
const std::string & aMaterialName )
private

◆ getMaterialResourceBlock()

std::shared_ptr< DATA_BLOCK > WRITER::getMaterialResourceBlock ( const std::string & aMaterialName,
const Graphic3d_Vec4 & aDiffuseColor,
const Graphic3d_Vec3 & aSpecularColor )
private

◆ GetMeshBoundingBox()

const Bnd_Box & U3D::WRITER::GetMeshBoundingBox ( ) const
inline

Definition at line 210 of file writer.h.

References m_meshBoundingBox.

Referenced by STEP_PCB_MODEL::WritePDF().

◆ getMeshContinuationBlock()

◆ getMeshDeclarationBlock()

◆ getMeshName()

void WRITER::getMeshName ( const TDF_Label & label,
Handle(XCAFDoc_ShapeTool) shapeTool,
MESH * mesh )
private

Definition at line 249 of file writer.cpp.

References KICAD3D_INFO::GetID(), Handle(), m_meshDedupMap, and U3D::MESH::name.

Referenced by generateMeshesByAssembly().

◆ getModelNodeBlock()

std::shared_ptr< DATA_BLOCK > WRITER::getModelNodeBlock ( const std::string & aModelNodeName,
const std::string & aParentNodeName,
const std::string & aModelResourceName,
const std::vector< float > & aMat )
private

◆ getModelResourceModifierChain()

std::shared_ptr< DATA_BLOCK > WRITER::getModelResourceModifierChain ( const std::string & aModifierChainName,
const MESH * aMesh,
const std::string & aMeshname )
private

◆ getNodeModifierChain()

std::shared_ptr< DATA_BLOCK > WRITER::getNodeModifierChain ( const std::string & aModifierChainName,
const std::string & aModelNodeName,
const std::string & aParentNodeName,
const std::string & aModelResourceName,
const std::string & aShaderName,
const std::vector< float > & aMat )
private

◆ getShadingModifierBlock()

std::shared_ptr< DATA_BLOCK > WRITER::getShadingModifierBlock ( const std::string & aShadingModName,
const std::string & aShaderName )
private

◆ Perform()

◆ writeDataBlock()

uint32_t WRITER::writeDataBlock ( std::shared_ptr< DATA_BLOCK > b,
wxMemoryOutputStream & aStream )
private

Definition at line 940 of file writer.cpp.

Referenced by Perform().

◆ writeMatrix()

void WRITER::writeMatrix ( BIT_STREAM_WRITER & aBitStreamWriter,
const std::vector< float > & aMat )
private

Member Data Documentation

◆ m_center

VECTOR3D U3D::WRITER::m_center
private

Definition at line 282 of file writer.h.

Referenced by GetCenter(), Perform(), and WRITER().

◆ m_contextBaseShadingID

const uint32_t U3D::WRITER::m_contextBaseShadingID = 1
private

Definition at line 285 of file writer.h.

Referenced by getMeshContinuationBlock().

◆ m_filename

std::string U3D::WRITER::m_filename
private

Definition at line 281 of file writer.h.

Referenced by Perform(), and WRITER().

◆ m_groupNodes

std::vector<GROUP_NODE> U3D::WRITER::m_groupNodes
private

Definition at line 288 of file writer.h.

Referenced by generateMeshesByAssembly(), and Perform().

◆ m_includeNormals

bool U3D::WRITER::m_includeNormals
private

Definition at line 286 of file writer.h.

Referenced by collectGeometryRecursive(), and WRITER().

◆ m_meshBoundingBox

Bnd_Box U3D::WRITER::m_meshBoundingBox
private

Definition at line 283 of file writer.h.

Referenced by collectGeometryRecursive(), GetMeshBoundingBox(), Perform(), and WRITER().

◆ m_meshDedupMap

std::map<std::string, int> U3D::WRITER::m_meshDedupMap
private

Definition at line 284 of file writer.h.

Referenced by generateMeshesByAssembly(), getMeshName(), Perform(), and WRITER().

◆ m_meshes

std::vector<std::unique_ptr<MESH> > U3D::WRITER::m_meshes
private

Definition at line 287 of file writer.h.

Referenced by collectGeometryRecursive(), generateMeshesByAssembly(), and Perform().


The documentation for this class was generated from the following files: