Add noexcept to some functions in the 3d viewer.

This commit is contained in:
Simon Richter 2020-04-16 16:11:21 +00:00 committed by Ian McInerney
parent 7513303cf4
commit 99c1d7cf96
30 changed files with 276 additions and 168 deletions

View File

@ -66,7 +66,7 @@ static std::mutex mutex3D_cache;
static std::mutex mutex3D_cacheManager; static std::mutex mutex3D_cacheManager;
static bool isSHA1Same( const unsigned char* shaA, const unsigned char* shaB ) static bool isSHA1Same( const unsigned char* shaA, const unsigned char* shaB ) noexcept
{ {
for( int i = 0; i < 20; ++i ) for( int i = 0; i < 20; ++i )
if( shaA[i] != shaB[i] ) if( shaA[i] != shaB[i] )
@ -613,7 +613,7 @@ void S3D_CACHE::SetProgramBase( PGM_BASE* aBase )
} }
FILENAME_RESOLVER* S3D_CACHE::GetResolver() FILENAME_RESOLVER* S3D_CACHE::GetResolver() noexcept
{ {
return m_FNResolver; return m_FNResolver;
} }

View File

@ -105,7 +105,7 @@ public:
S3D_CACHE(); S3D_CACHE();
virtual ~S3D_CACHE(); virtual ~S3D_CACHE();
KICAD_T Type() override KICAD_T Type() noexcept override
{ {
return S3D_CACHE_T; return S3D_CACHE_T;
} }
@ -151,7 +151,7 @@ public:
*/ */
SCENEGRAPH* Load( const wxString& aModelFile ); SCENEGRAPH* Load( const wxString& aModelFile );
FILENAME_RESOLVER* GetResolver(); FILENAME_RESOLVER* GetResolver() noexcept;
/** /**
* Function GetFileFilters * Function GetFileFilters

View File

@ -469,7 +469,7 @@ void S3D_PLUGIN_MANAGER::addExtensionMap( KICAD_PLUGIN_LDR_3D* aPlugin )
} }
std::list< wxString > const* S3D_PLUGIN_MANAGER::GetFileFilters( void ) const std::list< wxString > const* S3D_PLUGIN_MANAGER::GetFileFilters( void ) const noexcept
{ {
return &m_FileFilters; return &m_FileFilters;
} }

View File

@ -80,7 +80,7 @@ public:
* *
* @return a pointer to the internal filter list * @return a pointer to the internal filter list
*/ */
std::list< wxString > const* GetFileFilters( void ) const; std::list< wxString > const* GetFileFilters( void ) const noexcept;
SCENEGRAPH* Load3DModel( const wxString& aFileName, std::string& aPluginInfo ); SCENEGRAPH* Load3DModel( const wxString& aFileName, std::string& aPluginInfo );

View File

@ -207,7 +207,7 @@ void S3D::RenameNodes( SGNODE* aNode )
} }
void S3D::DestroyNode( SGNODE* aNode ) void S3D::DestroyNode( SGNODE* aNode ) noexcept
{ {
if( NULL == aNode ) if( NULL == aNode )
{ {
@ -585,7 +585,7 @@ void S3D::Init3DMesh( SMESH& aMesh )
void S3D::GetLibVersion( unsigned char* Major, unsigned char* Minor, void S3D::GetLibVersion( unsigned char* Major, unsigned char* Minor,
unsigned char* Patch, unsigned char* Revision ) unsigned char* Patch, unsigned char* Revision ) noexcept
{ {
if( Major ) if( Major )
*Major = KICADSG_VERSION_MAJOR; *Major = KICADSG_VERSION_MAJOR;

View File

@ -408,7 +408,7 @@ bool IFSG_APPEARANCE::SetAmbient( const SGCOLOR& aRGBColor )
} }
bool IFSG_APPEARANCE::SetShininess( float aShininess ) bool IFSG_APPEARANCE::SetShininess( float aShininess ) noexcept
{ {
if( NULL == m_node ) if( NULL == m_node )
{ {
@ -440,7 +440,7 @@ bool IFSG_APPEARANCE::SetShininess( float aShininess )
} }
bool IFSG_APPEARANCE::SetTransparency( float aTransparency ) bool IFSG_APPEARANCE::SetTransparency( float aTransparency ) noexcept
{ {
if( NULL == m_node ) if( NULL == m_node )
{ {

View File

@ -63,7 +63,7 @@ void IFSG_NODE::Destroy( void )
} }
SGNODE* IFSG_NODE::GetRawPtr( void ) SGNODE* IFSG_NODE::GetRawPtr( void ) noexcept
{ {
return m_node; return m_node;
} }

View File

@ -171,7 +171,7 @@ bool IFSG_TRANSFORM::SetRotation( const SGVECTOR& aRotationAxis, double aAngle )
} }
bool IFSG_TRANSFORM::SetScale( const SGPOINT& aScale ) bool IFSG_TRANSFORM::SetScale( const SGPOINT& aScale ) noexcept
{ {
if( NULL == m_node ) if( NULL == m_node )
{ {
@ -223,7 +223,7 @@ bool IFSG_TRANSFORM::SetScale( double aScale )
} }
bool IFSG_TRANSFORM::SetTranslation( const SGPOINT& aTranslation ) bool IFSG_TRANSFORM::SetTranslation( const SGPOINT& aTranslation ) noexcept
{ {
if( NULL == m_node ) if( NULL == m_node )
{ {
@ -264,7 +264,7 @@ bool IFSG_TRANSFORM::SetScaleOrientation( const SGVECTOR& aScaleAxis, double aAn
} }
bool IFSG_TRANSFORM::SetCenter( const SGPOINT& aCenter ) bool IFSG_TRANSFORM::SetCenter( const SGPOINT& aCenter ) noexcept
{ {
if( NULL == m_node ) if( NULL == m_node )
{ {

View File

@ -215,7 +215,7 @@ bool SGAPPEARANCE::SetAmbient( const SGCOLOR& aRGBColor )
} }
SGNODE* SGAPPEARANCE::FindNode(const char *aNodeName, const SGNODE *aCaller) SGNODE* SGAPPEARANCE::FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept
{ {
if( NULL == aNodeName || 0 == aNodeName[0] ) if( NULL == aNodeName || 0 == aNodeName[0] )
return NULL; return NULL;
@ -227,7 +227,7 @@ SGNODE* SGAPPEARANCE::FindNode(const char *aNodeName, const SGNODE *aCaller)
} }
void SGAPPEARANCE::unlinkChildNode( const SGNODE* aCaller ) void SGAPPEARANCE::unlinkChildNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -240,7 +240,7 @@ void SGAPPEARANCE::unlinkChildNode( const SGNODE* aCaller )
} }
void SGAPPEARANCE::unlinkRefNode( const SGNODE* aCaller ) void SGAPPEARANCE::unlinkRefNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -253,7 +253,7 @@ void SGAPPEARANCE::unlinkRefNode( const SGNODE* aCaller )
} }
bool SGAPPEARANCE::AddRefNode( SGNODE* aNode ) bool SGAPPEARANCE::AddRefNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -266,7 +266,7 @@ bool SGAPPEARANCE::AddRefNode( SGNODE* aNode )
} }
bool SGAPPEARANCE::AddChildNode( SGNODE* aNode ) bool SGAPPEARANCE::AddChildNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;

View File

@ -41,8 +41,8 @@ public:
SGCOLOR emissive; // default 0.0 0.0 0.0 SGCOLOR emissive; // default 0.0 0.0 0.0
SGCOLOR specular; // default 0.0 0.0 0.0 SGCOLOR specular; // default 0.0 0.0 0.0
void unlinkChildNode( const SGNODE* aNode ) override; void unlinkChildNode( const SGNODE* aNode ) noexcept override;
void unlinkRefNode( const SGNODE* aNode ) override; void unlinkRefNode( const SGNODE* aNode ) noexcept override;
public: public:
SGAPPEARANCE( SGNODE* aParent ); SGAPPEARANCE( SGNODE* aParent );
@ -66,9 +66,9 @@ public:
bool SetAmbient( const SGCOLOR* aRGBColor ); bool SetAmbient( const SGCOLOR* aRGBColor );
bool SetAmbient( const SGCOLOR& aRGBColor ); bool SetAmbient( const SGCOLOR& aRGBColor );
SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) override; SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept override;
bool AddRefNode( SGNODE* aNode ) override; bool AddRefNode( SGNODE* aNode ) noexcept override;
bool AddChildNode( SGNODE* aNode ) override; bool AddChildNode( SGNODE* aNode ) noexcept override;
void ReNameNodes( void ) override; void ReNameNodes( void ) override;
bool WriteVRML( std::ostream& aFile, bool aReuseFlag ) override; bool WriteVRML( std::ostream& aFile, bool aReuseFlag ) override;

View File

@ -62,7 +62,7 @@ SGCOLOR::SGCOLOR( float aRVal, float aGVal, float aBVal )
} }
void SGCOLOR::GetColor( float& aRedVal, float& aGreenVal, float& aBlueVal ) const void SGCOLOR::GetColor( float& aRedVal, float& aGreenVal, float& aBlueVal ) const noexcept
{ {
aRedVal = red; aRedVal = red;
aGreenVal = green; aGreenVal = green;
@ -71,7 +71,7 @@ void SGCOLOR::GetColor( float& aRedVal, float& aGreenVal, float& aBlueVal ) cons
} }
void SGCOLOR::GetColor( SGCOLOR& aColor ) const void SGCOLOR::GetColor( SGCOLOR& aColor ) const noexcept
{ {
aColor.red = red; aColor.red = red;
aColor.green = green; aColor.green = green;
@ -80,7 +80,7 @@ void SGCOLOR::GetColor( SGCOLOR& aColor ) const
} }
void SGCOLOR::GetColor( SGCOLOR* aColor ) const void SGCOLOR::GetColor( SGCOLOR* aColor ) const noexcept
{ {
if( NULL == aColor ) if( NULL == aColor )
{ {
@ -114,7 +114,7 @@ bool SGCOLOR::SetColor( float aRedVal, float aGreenVal, float aBlueVal )
} }
bool SGCOLOR::SetColor( const SGCOLOR& aColor ) bool SGCOLOR::SetColor( const SGCOLOR& aColor ) noexcept
{ {
red = aColor.red; red = aColor.red;
green = aColor.green; green = aColor.green;
@ -123,7 +123,7 @@ bool SGCOLOR::SetColor( const SGCOLOR& aColor )
} }
bool SGCOLOR::SetColor( const SGCOLOR* aColor ) bool SGCOLOR::SetColor( const SGCOLOR* aColor ) noexcept
{ {
if( NULL == aColor ) if( NULL == aColor )
{ {
@ -144,7 +144,7 @@ bool SGCOLOR::SetColor( const SGCOLOR* aColor )
} }
bool SGCOLOR::checkRange( float aRedVal, float aGreenVal, float aBlueVal ) const bool SGCOLOR::checkRange( float aRedVal, float aGreenVal, float aBlueVal ) const noexcept
{ {
bool ok = true; bool ok = true;
@ -196,7 +196,7 @@ SGPOINT::SGPOINT()
} }
SGPOINT::SGPOINT( double aXVal, double aYVal, double aZVal ) SGPOINT::SGPOINT( double aXVal, double aYVal, double aZVal ) noexcept
{ {
x = aXVal; x = aXVal;
y = aYVal; y = aYVal;
@ -204,7 +204,7 @@ SGPOINT::SGPOINT( double aXVal, double aYVal, double aZVal )
} }
void SGPOINT::GetPoint( double& aXVal, double& aYVal, double& aZVal ) void SGPOINT::GetPoint( double& aXVal, double& aYVal, double& aZVal ) noexcept
{ {
x = aXVal; x = aXVal;
y = aYVal; y = aYVal;
@ -213,7 +213,7 @@ void SGPOINT::GetPoint( double& aXVal, double& aYVal, double& aZVal )
} }
void SGPOINT::GetPoint( SGPOINT& aPoint ) void SGPOINT::GetPoint( SGPOINT& aPoint ) noexcept
{ {
x = aPoint.x; x = aPoint.x;
y = aPoint.y; y = aPoint.y;
@ -222,7 +222,7 @@ void SGPOINT::GetPoint( SGPOINT& aPoint )
} }
void SGPOINT::GetPoint( SGPOINT* aPoint ) void SGPOINT::GetPoint( SGPOINT* aPoint ) noexcept
{ {
if( NULL == aPoint ) if( NULL == aPoint )
{ {
@ -243,7 +243,7 @@ void SGPOINT::GetPoint( SGPOINT* aPoint )
} }
void SGPOINT::SetPoint( double aXVal, double aYVal, double aZVal ) void SGPOINT::SetPoint( double aXVal, double aYVal, double aZVal ) noexcept
{ {
x = aXVal; x = aXVal;
y = aYVal; y = aYVal;
@ -252,7 +252,7 @@ void SGPOINT::SetPoint( double aXVal, double aYVal, double aZVal )
} }
void SGPOINT::SetPoint( const SGPOINT& aPoint ) void SGPOINT::SetPoint( const SGPOINT& aPoint ) noexcept
{ {
x = aPoint.x; x = aPoint.x;
y = aPoint.y; y = aPoint.y;
@ -280,7 +280,7 @@ SGVECTOR::SGVECTOR( double aXVal, double aYVal, double aZVal )
} }
void SGVECTOR::GetVector( double& aXVal, double& aYVal, double& aZVal ) const void SGVECTOR::GetVector( double& aXVal, double& aYVal, double& aZVal ) const noexcept
{ {
aXVal = vx; aXVal = vx;
aYVal = vy; aYVal = vy;
@ -306,7 +306,7 @@ void SGVECTOR::SetVector( const SGVECTOR& aVector )
} }
void SGVECTOR::normalize( void ) void SGVECTOR::normalize( void ) noexcept
{ {
double dx = vx * vx; double dx = vx * vx;
double dy = vy * vy; double dy = vy * vy;
@ -331,7 +331,7 @@ void SGVECTOR::normalize( void )
} }
SGVECTOR& SGVECTOR::operator=( const SGVECTOR& source ) SGVECTOR& SGVECTOR::operator=( const SGVECTOR& source ) noexcept
{ {
vx = source.vx; vx = source.vx;
vy = source.vy; vy = source.vy;

View File

@ -90,7 +90,7 @@ bool SGCOLORS::SetParent( SGNODE* aParent, bool notify )
} }
SGNODE* SGCOLORS::FindNode(const char *aNodeName, const SGNODE *aCaller) SGNODE* SGCOLORS::FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept
{ {
if( NULL == aNodeName || 0 == aNodeName[0] ) if( NULL == aNodeName || 0 == aNodeName[0] )
return NULL; return NULL;
@ -102,7 +102,7 @@ SGNODE* SGCOLORS::FindNode(const char *aNodeName, const SGNODE *aCaller)
} }
void SGCOLORS::unlinkChildNode( const SGNODE* aCaller ) void SGCOLORS::unlinkChildNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -115,7 +115,7 @@ void SGCOLORS::unlinkChildNode( const SGNODE* aCaller )
} }
void SGCOLORS::unlinkRefNode( const SGNODE* aCaller ) void SGCOLORS::unlinkRefNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -128,7 +128,7 @@ void SGCOLORS::unlinkRefNode( const SGNODE* aCaller )
} }
bool SGCOLORS::AddRefNode( SGNODE* aNode ) bool SGCOLORS::AddRefNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -141,7 +141,7 @@ bool SGCOLORS::AddRefNode( SGNODE* aNode )
} }
bool SGCOLORS::AddChildNode( SGNODE* aNode ) bool SGCOLORS::AddChildNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;

View File

@ -37,8 +37,8 @@ class SGCOLORS : public SGNODE
public: public:
std::vector< SGCOLOR > colors; std::vector< SGCOLOR > colors;
void unlinkChildNode( const SGNODE* aNode ) override; void unlinkChildNode( const SGNODE* aNode ) noexcept override;
void unlinkRefNode( const SGNODE* aNode ) override; void unlinkRefNode( const SGNODE* aNode ) noexcept override;
public: public:
SGCOLORS( SGNODE* aParent ); SGCOLORS( SGNODE* aParent );
@ -46,9 +46,9 @@ public:
virtual bool SetParent( SGNODE* aParent, bool notify = true ) override; virtual bool SetParent( SGNODE* aParent, bool notify = true ) override;
SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) override; SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept override;
bool AddRefNode( SGNODE* aNode ) override; bool AddRefNode( SGNODE* aNode ) noexcept override;
bool AddChildNode( SGNODE* aNode ) override; bool AddChildNode( SGNODE* aNode ) noexcept override;
bool GetColorList( size_t& aListSize, SGCOLOR*& aColorList ); bool GetColorList( size_t& aListSize, SGCOLOR*& aColorList );
void SetColorList( size_t aListSize, const SGCOLOR* aColorList ); void SetColorList( size_t aListSize, const SGCOLOR* aColorList );

View File

@ -93,7 +93,7 @@ bool SGCOORDS::SetParent( SGNODE* aParent, bool notify )
} }
SGNODE* SGCOORDS::FindNode(const char *aNodeName, const SGNODE *aCaller) SGNODE* SGCOORDS::FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept
{ {
if( NULL == aNodeName || 0 == aNodeName[0] ) if( NULL == aNodeName || 0 == aNodeName[0] )
return NULL; return NULL;
@ -105,7 +105,7 @@ SGNODE* SGCOORDS::FindNode(const char *aNodeName, const SGNODE *aCaller)
} }
void SGCOORDS::unlinkChildNode( const SGNODE* aCaller ) void SGCOORDS::unlinkChildNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -118,7 +118,7 @@ void SGCOORDS::unlinkChildNode( const SGNODE* aCaller )
} }
void SGCOORDS::unlinkRefNode( const SGNODE* aCaller ) void SGCOORDS::unlinkRefNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -131,7 +131,7 @@ void SGCOORDS::unlinkRefNode( const SGNODE* aCaller )
} }
bool SGCOORDS::AddRefNode( SGNODE* aNode ) bool SGCOORDS::AddRefNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -144,7 +144,7 @@ bool SGCOORDS::AddRefNode( SGNODE* aNode )
} }
bool SGCOORDS::AddChildNode( SGNODE* aNode ) bool SGCOORDS::AddChildNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;

View File

@ -39,8 +39,8 @@ class SGCOORDS : public SGNODE
public: public:
std::vector< SGPOINT > coords; std::vector< SGPOINT > coords;
void unlinkChildNode( const SGNODE* aNode ) override; void unlinkChildNode( const SGNODE* aNode ) noexcept override;
void unlinkRefNode( const SGNODE* aNode ) override; void unlinkRefNode( const SGNODE* aNode ) noexcept override;
public: public:
SGCOORDS( SGNODE* aParent ); SGCOORDS( SGNODE* aParent );
@ -48,9 +48,9 @@ public:
virtual bool SetParent( SGNODE* aParent, bool notify = true ) override; virtual bool SetParent( SGNODE* aParent, bool notify = true ) override;
SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) override; SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept override;
bool AddRefNode( SGNODE* aNode ) override; bool AddRefNode( SGNODE* aNode ) noexcept override;
bool AddChildNode( SGNODE* aNode ) override; bool AddChildNode( SGNODE* aNode ) noexcept override;
bool GetCoordsList( size_t& aListSize, SGPOINT*& aCoordsList ); bool GetCoordsList( size_t& aListSize, SGPOINT*& aCoordsList );
void SetCoordsList( size_t aListSize, const SGPOINT* aCoordsList ); void SetCoordsList( size_t aListSize, const SGPOINT* aCoordsList );

View File

@ -336,7 +336,7 @@ bool S3D::ReadColor( std::istream& aFile, SGCOLOR& aColor )
} }
bool S3D::degenerate( glm::dvec3* pts ) bool S3D::degenerate( glm::dvec3* pts ) noexcept
{ {
double dx, dy, dz; double dx, dy, dz;

View File

@ -161,7 +161,7 @@ class SGCOORDINDEX;
namespace S3D namespace S3D
{ {
bool degenerate( glm::dvec3* pts ); bool degenerate( glm::dvec3* pts ) noexcept;
// //
// Normals calculations from triangles // Normals calculations from triangles

View File

@ -84,7 +84,7 @@ bool SGINDEX::SetParent( SGNODE* aParent, bool notify )
} }
SGNODE* SGINDEX::FindNode(const char *aNodeName, const SGNODE *aCaller) SGNODE* SGINDEX::FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept
{ {
if( NULL == aNodeName || 0 == aNodeName[0] ) if( NULL == aNodeName || 0 == aNodeName[0] )
return NULL; return NULL;
@ -96,7 +96,7 @@ SGNODE* SGINDEX::FindNode(const char *aNodeName, const SGNODE *aCaller)
} }
void SGINDEX::unlinkChildNode( const SGNODE* aCaller ) void SGINDEX::unlinkChildNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -109,7 +109,7 @@ void SGINDEX::unlinkChildNode( const SGNODE* aCaller )
} }
void SGINDEX::unlinkRefNode( const SGNODE* aCaller ) void SGINDEX::unlinkRefNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -122,7 +122,7 @@ void SGINDEX::unlinkRefNode( const SGNODE* aCaller )
} }
bool SGINDEX::AddRefNode( SGNODE* aNode ) bool SGINDEX::AddRefNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -135,7 +135,7 @@ bool SGINDEX::AddRefNode( SGNODE* aNode )
} }
bool SGINDEX::AddChildNode( SGNODE* aNode ) bool SGINDEX::AddChildNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;

View File

@ -42,8 +42,8 @@ protected:
public: public:
// for internal SG consumption only // for internal SG consumption only
std::vector< int > index; std::vector< int > index;
void unlinkChildNode( const SGNODE* aCaller ) override; void unlinkChildNode( const SGNODE* aCaller ) noexcept override;
void unlinkRefNode( const SGNODE* aCaller ) override; void unlinkRefNode( const SGNODE* aCaller ) noexcept override;
public: public:
SGINDEX( SGNODE* aParent ); SGINDEX( SGNODE* aParent );
@ -51,9 +51,9 @@ public:
virtual bool SetParent( SGNODE* aParent, bool notify = true ) override; virtual bool SetParent( SGNODE* aParent, bool notify = true ) override;
SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) override; SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept override;
bool AddRefNode( SGNODE* aNode ) override; bool AddRefNode( SGNODE* aNode ) noexcept override;
bool AddChildNode( SGNODE* aNode ) override; bool AddChildNode( SGNODE* aNode ) noexcept override;
/** /**
* Function GetIndices * Function GetIndices

View File

@ -48,7 +48,7 @@ static const std::string node_names[S3D::SGTYPE_END + 1] = {
static unsigned int node_counts[S3D::SGTYPE_END] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static unsigned int node_counts[S3D::SGTYPE_END] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 };
char const* S3D::GetNodeTypeName( S3D::SGTYPES aType ) char const* S3D::GetNodeTypeName( S3D::SGTYPES aType ) noexcept
{ {
return node_names[aType].c_str(); return node_names[aType].c_str();
} }
@ -105,13 +105,13 @@ SGNODE::~SGNODE()
} }
S3D::SGTYPES SGNODE::GetNodeType( void ) const S3D::SGTYPES SGNODE::GetNodeType( void ) const noexcept
{ {
return m_SGtype; return m_SGtype;
} }
SGNODE* SGNODE::GetParent( void ) const SGNODE* SGNODE::GetParent( void ) const noexcept
{ {
return m_Parent; return m_Parent;
} }
@ -167,7 +167,7 @@ void SGNODE::SetName( const char *aName )
} }
const char * SGNODE::GetNodeTypeName( S3D::SGTYPES aNodeType ) const const char * SGNODE::GetNodeTypeName( S3D::SGTYPES aNodeType ) const noexcept
{ {
return node_names[aNodeType].c_str(); return node_names[aNodeType].c_str();
} }
@ -216,7 +216,7 @@ void SGNODE::delNodeRef( const SGNODE* aNode )
} }
void SGNODE::AssociateWrapper( SGNODE** aWrapperRef ) void SGNODE::AssociateWrapper( SGNODE** aWrapperRef ) noexcept
{ {
if( NULL == aWrapperRef ) if( NULL == aWrapperRef )
{ {
@ -261,7 +261,7 @@ void SGNODE::AssociateWrapper( SGNODE** aWrapperRef )
return; return;
} }
void SGNODE::DisassociateWrapper( SGNODE** aWrapperRef ) void SGNODE::DisassociateWrapper( SGNODE** aWrapperRef ) noexcept
{ {
if( !m_Association ) if( !m_Association )
return; return;
@ -301,7 +301,7 @@ void SGNODE::DisassociateWrapper( SGNODE** aWrapperRef )
} }
void SGNODE::ResetNodeIndex( void ) void SGNODE::ResetNodeIndex( void ) noexcept
{ {
for( int i = 0; i < (int)S3D::SGTYPE_END; ++i ) for( int i = 0; i < (int)S3D::SGTYPE_END; ++i )
node_counts[i] = 1; node_counts[i] = 1;
@ -362,19 +362,19 @@ void S3D::INIT_SMATERIAL( SMATERIAL& aMaterial )
} }
void S3D::INIT_SMESH( SMESH& aMesh ) void S3D::INIT_SMESH( SMESH& aMesh ) noexcept
{ {
aMesh = {}; aMesh = {};
} }
void S3D::INIT_S3DMODEL( S3DMODEL& aModel ) void S3D::INIT_S3DMODEL( S3DMODEL& aModel ) noexcept
{ {
aModel = {}; aModel = {};
} }
void S3D::FREE_SMESH( SMESH& aMesh) void S3D::FREE_SMESH( SMESH& aMesh) noexcept
{ {
if( NULL != aMesh.m_Positions ) if( NULL != aMesh.m_Positions )
{ {

View File

@ -50,7 +50,7 @@ namespace S3D
* Function GetNodeTypeName * Function GetNodeTypeName
* returns the name of the given type of node * returns the name of the given type of node
*/ */
char const* GetNodeTypeName( S3D::SGTYPES aType ); char const* GetNodeTypeName( S3D::SGTYPES aType ) noexcept;
struct MATLIST struct MATLIST
{ {
@ -61,10 +61,10 @@ namespace S3D
bool GetMatIndex( MATLIST& aList, SGNODE* aNode, int& aIndex ); bool GetMatIndex( MATLIST& aList, SGNODE* aNode, int& aIndex );
void INIT_SMATERIAL( SMATERIAL& aMaterial ); void INIT_SMATERIAL( SMATERIAL& aMaterial );
void INIT_SMESH( SMESH& aMesh ); void INIT_SMESH( SMESH& aMesh ) noexcept;
void INIT_S3DMODEL( S3DMODEL& aModel ); void INIT_S3DMODEL( S3DMODEL& aModel ) noexcept;
void FREE_SMESH( SMESH& aMesh); void FREE_SMESH( SMESH& aMesh) noexcept;
void FREE_S3DMODEL( S3DMODEL& aModel ); void FREE_S3DMODEL( S3DMODEL& aModel );
} }
@ -127,7 +127,7 @@ public:
* returns true if the object had already been written to a * returns true if the object had already been written to a
* cache file or VRML file; for internal use only. * cache file or VRML file; for internal use only.
*/ */
bool isWritten( void ) bool isWritten( void ) noexcept
{ {
return m_written; return m_written;
} }
@ -140,14 +140,14 @@ public:
* Function GetNodeType * Function GetNodeType
* returns the type of this node instance * returns the type of this node instance
*/ */
S3D::SGTYPES GetNodeType( void ) const; S3D::SGTYPES GetNodeType( void ) const noexcept;
/** /**
* Function GetParent * Function GetParent
* returns a pointer to the parent SGNODE of this object * returns a pointer to the parent SGNODE of this object
* or NULL if the object has no parent (ie. top level transform) * or NULL if the object has no parent (ie. top level transform)
*/ */
SGNODE* GetParent( void ) const; SGNODE* GetParent( void ) const noexcept;
/** /**
* Function SetParent * Function SetParent
@ -174,7 +174,7 @@ public:
const char* GetName( void ); const char* GetName( void );
void SetName(const char *aName); void SetName(const char *aName);
const char * GetNodeTypeName( S3D::SGTYPES aNodeType ) const; const char * GetNodeTypeName( S3D::SGTYPES aNodeType ) const noexcept;
/** /**
* Function FindNode searches the tree of linked nodes and returns a * Function FindNode searches the tree of linked nodes and returns a
@ -199,21 +199,21 @@ public:
* This mechanism provides a scheme by which a wrapper can be * This mechanism provides a scheme by which a wrapper can be
* notified of the destruction of the object which it wraps. * notified of the destruction of the object which it wraps.
*/ */
void AssociateWrapper( SGNODE** aWrapperRef ); void AssociateWrapper( SGNODE** aWrapperRef ) noexcept;
/** /**
* Function DisassociateWrapper * Function DisassociateWrapper
* removes the association between an IFSG* wrapper * removes the association between an IFSG* wrapper
* object and this object. * object and this object.
*/ */
void DisassociateWrapper( SGNODE** aWrapperRef ); void DisassociateWrapper( SGNODE** aWrapperRef ) noexcept;
/** /**
* Function ResetNodeIndex * Function ResetNodeIndex
* resets the global SG* node indices in preparation for * resets the global SG* node indices in preparation for
* Write() operations * Write() operations
*/ */
void ResetNodeIndex( void ); void ResetNodeIndex( void ) noexcept;
/** /**
* Function ReNameNodes * Function ReNameNodes

View File

@ -91,7 +91,7 @@ bool SGNORMALS::SetParent( SGNODE* aParent, bool notify )
} }
SGNODE* SGNORMALS::FindNode(const char *aNodeName, const SGNODE *aCaller) SGNODE* SGNORMALS::FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept
{ {
if( NULL == aNodeName || 0 == aNodeName[0] ) if( NULL == aNodeName || 0 == aNodeName[0] )
return NULL; return NULL;
@ -103,7 +103,7 @@ SGNODE* SGNORMALS::FindNode(const char *aNodeName, const SGNODE *aCaller)
} }
void SGNORMALS::unlinkChildNode( const SGNODE* aCaller ) void SGNORMALS::unlinkChildNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -116,7 +116,7 @@ void SGNORMALS::unlinkChildNode( const SGNODE* aCaller )
} }
void SGNORMALS::unlinkRefNode( const SGNODE* aCaller ) void SGNORMALS::unlinkRefNode( const SGNODE* aCaller ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -129,7 +129,7 @@ void SGNORMALS::unlinkRefNode( const SGNODE* aCaller )
} }
bool SGNORMALS::AddRefNode( SGNODE* aNode ) bool SGNORMALS::AddRefNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;
@ -142,7 +142,7 @@ bool SGNORMALS::AddRefNode( SGNODE* aNode )
} }
bool SGNORMALS::AddChildNode( SGNODE* aNode ) bool SGNORMALS::AddChildNode( SGNODE* aNode ) noexcept
{ {
#ifdef DEBUG #ifdef DEBUG
std::ostringstream ostr; std::ostringstream ostr;

View File

@ -37,8 +37,8 @@ class SGNORMALS : public SGNODE
public: public:
std::vector< SGVECTOR > norms; std::vector< SGVECTOR > norms;
void unlinkChildNode( const SGNODE* aNode ) override; void unlinkChildNode( const SGNODE* aNode ) noexcept override;
void unlinkRefNode( const SGNODE* aNode ) override; void unlinkRefNode( const SGNODE* aNode ) noexcept override;
public: public:
SGNORMALS( SGNODE* aParent ); SGNORMALS( SGNODE* aParent );
@ -46,9 +46,9 @@ public:
virtual bool SetParent( SGNODE* aParent, bool notify = true ) override; virtual bool SetParent( SGNODE* aParent, bool notify = true ) override;
SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) override; SGNODE* FindNode(const char *aNodeName, const SGNODE *aCaller) noexcept override;
bool AddRefNode( SGNODE* aNode ) override; bool AddRefNode( SGNODE* aNode ) noexcept override;
bool AddChildNode( SGNODE* aNode ) override; bool AddChildNode( SGNODE* aNode ) noexcept override;
bool GetNormalList( size_t& aListSize, SGVECTOR*& aNormalList ); bool GetNormalList( size_t& aListSize, SGVECTOR*& aNormalList );
void SetNormalList( size_t aListSize, const SGVECTOR* aNormalList ); void SetNormalList( size_t aListSize, const SGVECTOR* aNormalList );

View File

@ -238,7 +238,7 @@ bool BOARD_ADAPTER::ShouldModuleBeDisplayed( MODULE_ATTR_T aModuleAttributs ) co
#define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 um #define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 um
#define TECH_LAYER_THICKNESS KiROUND( 0.04 * IU_PER_MM ) #define TECH_LAYER_THICKNESS KiROUND( 0.04 * IU_PER_MM )
int BOARD_ADAPTER::GetCopperThicknessBIU() const int BOARD_ADAPTER::GetCopperThicknessBIU() const noexcept
{ {
return COPPER_THICKNESS; return COPPER_THICKNESS;
} }

View File

@ -76,13 +76,19 @@ class BOARD_ADAPTER
* @brief Set3DCacheManager - Update the Cache manager pointer * @brief Set3DCacheManager - Update the Cache manager pointer
* @param aCachePointer: the pointer to the 3d cache manager * @param aCachePointer: the pointer to the 3d cache manager
*/ */
void Set3DCacheManager( S3D_CACHE *aCachePointer ) { m_3d_model_manager = aCachePointer; } void Set3DCacheManager( S3D_CACHE *aCachePointer ) noexcept
{
m_3d_model_manager = aCachePointer;
}
/** /**
* @brief Get3DCacheManager - Return the 3d cache manager pointer * @brief Get3DCacheManager - Return the 3d cache manager pointer
* @return * @return
*/ */
S3D_CACHE *Get3DCacheManager( ) const { return m_3d_model_manager; } S3D_CACHE *Get3DCacheManager( ) const noexcept
{
return m_3d_model_manager;
}
/** /**
* @brief GetFlag - get a configuration status of a flag * @brief GetFlag - get a configuration status of a flag
@ -116,15 +122,24 @@ class BOARD_ADAPTER
* @brief SetBoard - Set current board to be rendered * @brief SetBoard - Set current board to be rendered
* @param aBoard: board to process * @param aBoard: board to process
*/ */
void SetBoard( BOARD *aBoard ) { m_board = aBoard; } void SetBoard( BOARD *aBoard ) noexcept
{
m_board = aBoard;
}
/** /**
* @brief GetBoard - Get current board to be rendered * @brief GetBoard - Get current board to be rendered
* @return BOARD pointer * @return BOARD pointer
*/ */
const BOARD *GetBoard() const { return m_board; } const BOARD *GetBoard() const noexcept
{
return m_board;
}
void SetColorSettings( COLOR_SETTINGS* aSettings ) { m_colors = aSettings; } void SetColorSettings( COLOR_SETTINGS* aSettings ) noexcept
{
m_colors = aSettings;
}
/** /**
* @brief InitSettings - Function to be called by the render when it need to * @brief InitSettings - Function to be called by the render when it need to
@ -138,55 +153,79 @@ class BOARD_ADAPTER
* @brief BiuTo3Dunits - Board integer units To 3D units * @brief BiuTo3Dunits - Board integer units To 3D units
* @return the conversion factor to transform a position from the board to 3d units * @return the conversion factor to transform a position from the board to 3d units
*/ */
double BiuTo3Dunits() const { return m_biuTo3Dunits; } double BiuTo3Dunits() const noexcept
{
return m_biuTo3Dunits;
}
/** /**
* @brief GetBBox3DU - Get the bbox of the pcb board * @brief GetBBox3DU - Get the bbox of the pcb board
* @return the board bbox in 3d units * @return the board bbox in 3d units
*/ */
const CBBOX &GetBBox3DU() const { return m_boardBoundingBox; } const CBBOX &GetBBox3DU() const noexcept
{
return m_boardBoundingBox;
}
/** /**
* @brief GetEpoxyThickness3DU - Get the current epoxy thickness * @brief GetEpoxyThickness3DU - Get the current epoxy thickness
* @return thickness in 3d unities * @return thickness in 3d unities
*/ */
float GetEpoxyThickness3DU() const { return m_epoxyThickness3DU; } float GetEpoxyThickness3DU() const noexcept
{
return m_epoxyThickness3DU;
}
/** /**
* @brief GetNonCopperLayerThickness3DU - Get the current non copper layers thickness * @brief GetNonCopperLayerThickness3DU - Get the current non copper layers thickness
* @return thickness in 3d unities of non copperlayers * @return thickness in 3d unities of non copperlayers
*/ */
float GetNonCopperLayerThickness3DU() const { return m_nonCopperLayerThickness3DU; } float GetNonCopperLayerThickness3DU() const noexcept
{
return m_nonCopperLayerThickness3DU;
}
/** /**
* @brief GetCopperThickness3DU - Get the current copper layer thickness * @brief GetCopperThickness3DU - Get the current copper layer thickness
* @return thickness in 3d unities of copperlayers * @return thickness in 3d unities of copperlayers
*/ */
float GetCopperThickness3DU() const { return m_copperThickness3DU; } float GetCopperThickness3DU() const noexcept
{
return m_copperThickness3DU;
}
/** /**
* @brief GetCopperThicknessBIU - Get the current copper layer thickness * @brief GetCopperThicknessBIU - Get the current copper layer thickness
* @return thickness in board unities * @return thickness in board unities
*/ */
int GetCopperThicknessBIU() const; int GetCopperThicknessBIU() const noexcept;
/** /**
* @brief GetBoardSizeBIU - Get the board size * @brief GetBoardSizeBIU - Get the board size
* @return size in BIU unities * @return size in BIU unities
*/ */
wxSize GetBoardSizeBIU() const { return m_boardSize; } wxSize GetBoardSizeBIU() const noexcept
{
return m_boardSize;
}
/** /**
* @brief GetBoardPosBIU - Get the board size * @brief GetBoardPosBIU - Get the board size
* @return size in BIU unities * @return size in BIU unities
*/ */
wxPoint GetBoardPosBIU() const { return m_boardPos; } wxPoint GetBoardPosBIU() const noexcept
{
return m_boardPos;
}
/** /**
* @brief GetBoardCenter - the board center position in 3d units * @brief GetBoardCenter - the board center position in 3d units
* @return board center vector position in 3d units * @return board center vector position in 3d units
*/ */
const SFVEC3F &GetBoardCenter3DU() const { return m_boardCenter; } const SFVEC3F &GetBoardCenter3DU() const noexcept
{
return m_boardCenter;
}
/** /**
* @brief GetModulesZcoord3DIU - Get the position of the module in 3d integer units * @brief GetModulesZcoord3DIU - Get the position of the module in 3d integer units
@ -201,43 +240,64 @@ class BOARD_ADAPTER
* @brief GridGet - get the current grid * @brief GridGet - get the current grid
* @return space type of the grid * @return space type of the grid
*/ */
GRID3D_TYPE GridGet() const { return m_3D_grid_type; } GRID3D_TYPE GridGet() const noexcept
{
return m_3D_grid_type;
}
/** /**
* @brief GridSet - set the current grid * @brief GridSet - set the current grid
* @param aGridType = the type space of the grid * @param aGridType = the type space of the grid
*/ */
void GridSet( GRID3D_TYPE aGridType ) { m_3D_grid_type = aGridType; } void GridSet( GRID3D_TYPE aGridType ) noexcept
{
m_3D_grid_type = aGridType;
}
/** /**
* @brief RenderEngineSet * @brief RenderEngineSet
* @param aRenderEngine = the render engine mode selected * @param aRenderEngine = the render engine mode selected
*/ */
void RenderEngineSet( RENDER_ENGINE aRenderEngine ) { m_render_engine = aRenderEngine; } void RenderEngineSet( RENDER_ENGINE aRenderEngine ) noexcept
{
m_render_engine = aRenderEngine;
}
/** /**
* @brief RenderEngineGet * @brief RenderEngineGet
* @return render engine on use * @return render engine on use
*/ */
RENDER_ENGINE RenderEngineGet() const { return m_render_engine; } RENDER_ENGINE RenderEngineGet() const noexcept
{
return m_render_engine;
}
/** /**
* @brief MaterialModeSet * @brief MaterialModeSet
* @param aMaterialMode = the render material mode * @param aMaterialMode = the render material mode
*/ */
void MaterialModeSet( MATERIAL_MODE aMaterialMode ) { m_material_mode = aMaterialMode; } void MaterialModeSet( MATERIAL_MODE aMaterialMode ) noexcept
{
m_material_mode = aMaterialMode;
}
/** /**
* @brief MaterialModeGet * @brief MaterialModeGet
* @return material rendering mode * @return material rendering mode
*/ */
MATERIAL_MODE MaterialModeGet() const { return m_material_mode; } MATERIAL_MODE MaterialModeGet() const noexcept
{
return m_material_mode;
}
/** /**
* @brief GetBoardPoly - Get the current polygon of the epoxy board * @brief GetBoardPoly - Get the current polygon of the epoxy board
* @return the shape polygon * @return the shape polygon
*/ */
const SHAPE_POLY_SET &GetBoardPoly() const { return m_board_poly; } const SHAPE_POLY_SET &GetBoardPoly() const noexcept
{
return m_board_poly;
}
/** /**
* @brief GetLayerColor - get the technical color of a layer * @brief GetLayerColor - get the technical color of a layer
@ -265,7 +325,7 @@ class BOARD_ADAPTER
* @param aLayerId: layer id * @param aLayerId: layer id
* @return position in 3D unities * @return position in 3D unities
*/ */
float GetLayerTopZpos3DU( PCB_LAYER_ID aLayerId ) const float GetLayerTopZpos3DU( PCB_LAYER_ID aLayerId ) const noexcept
{ {
return m_layerZcoordTop[aLayerId]; return m_layerZcoordTop[aLayerId];
} }
@ -275,7 +335,7 @@ class BOARD_ADAPTER
* @param aLayerId: layer id * @param aLayerId: layer id
* @return position in 3D unities * @return position in 3D unities
*/ */
float GetLayerBottomZpos3DU( PCB_LAYER_ID aLayerId ) const float GetLayerBottomZpos3DU( PCB_LAYER_ID aLayerId ) const noexcept
{ {
return m_layerZcoordBottom[aLayerId]; return m_layerZcoordBottom[aLayerId];
} }
@ -284,31 +344,43 @@ class BOARD_ADAPTER
* @brief GetMapLayers - Get the map of container that have the objects per layer * @brief GetMapLayers - Get the map of container that have the objects per layer
* @return the map containers of this board * @return the map containers of this board
*/ */
const MAP_CONTAINER_2D &GetMapLayers() const { return m_layers_container2D; } const MAP_CONTAINER_2D &GetMapLayers() const noexcept
{
return m_layers_container2D;
}
/** /**
* @brief GetMapLayersHoles -Get the map of container that have the holes per layer * @brief GetMapLayersHoles -Get the map of container that have the holes per layer
* @return the map containers of holes from this board * @return the map containers of holes from this board
*/ */
const MAP_CONTAINER_2D &GetMapLayersHoles() const { return m_layers_holes2D; } const MAP_CONTAINER_2D &GetMapLayersHoles() const noexcept
{
return m_layers_holes2D;
}
/** /**
* @brief GetThroughHole_Outer - Get the inflated ThroughHole container * @brief GetThroughHole_Outer - Get the inflated ThroughHole container
* @return a container with holes * @return a container with holes
*/ */
const CBVHCONTAINER2D &GetThroughHole_Outer() const { return m_through_holes_outer; } const CBVHCONTAINER2D &GetThroughHole_Outer() const noexcept
{
return m_through_holes_outer;
}
/** /**
* @brief GetThroughHole_Outer_poly - * @brief GetThroughHole_Outer_poly -
* @return * @return
*/ */
const SHAPE_POLY_SET &GetThroughHole_Outer_poly() const { return m_through_outer_holes_poly; } const SHAPE_POLY_SET &GetThroughHole_Outer_poly() const noexcept
{
return m_through_outer_holes_poly;
}
/** /**
* @brief GetThroughHole_Outer_poly_NPTH - * @brief GetThroughHole_Outer_poly_NPTH -
* @return * @return
*/ */
const SHAPE_POLY_SET &GetThroughHole_Outer_poly_NPTH() const const SHAPE_POLY_SET &GetThroughHole_Outer_poly_NPTH() const noexcept
{ {
return m_through_outer_holes_poly_NPTH; return m_through_outer_holes_poly_NPTH;
} }
@ -317,18 +389,24 @@ class BOARD_ADAPTER
* @brief GetThroughHole_Vias_Outer - * @brief GetThroughHole_Vias_Outer -
* @return a container with via THT holes only * @return a container with via THT holes only
*/ */
const CBVHCONTAINER2D &GetThroughHole_Vias_Outer() const { return m_through_holes_vias_outer; } const CBVHCONTAINER2D &GetThroughHole_Vias_Outer() const noexcept
{
return m_through_holes_vias_outer;
}
/** /**
* @brief GetThroughHole_Vias_Inner - * @brief GetThroughHole_Vias_Inner -
* @return a container with via THT holes only * @return a container with via THT holes only
*/ */
const CBVHCONTAINER2D &GetThroughHole_Vias_Inner() const { return m_through_holes_vias_inner; } const CBVHCONTAINER2D &GetThroughHole_Vias_Inner() const noexcept
{
return m_through_holes_vias_inner;
}
/** /**
* @brief GetThroughHole_Vias_Outer_poly - * @brief GetThroughHole_Vias_Outer_poly -
*/ */
const SHAPE_POLY_SET &GetThroughHole_Vias_Outer_poly() const const SHAPE_POLY_SET &GetThroughHole_Vias_Outer_poly() const noexcept
{ {
return m_through_outer_holes_vias_poly; return m_through_outer_holes_vias_poly;
} }
@ -336,7 +414,7 @@ class BOARD_ADAPTER
/** /**
* @brief GetThroughHole_Vias_Inner_poly - * @brief GetThroughHole_Vias_Inner_poly -
*/ */
const SHAPE_POLY_SET &GetThroughHole_Vias_Inner_poly() const const SHAPE_POLY_SET &GetThroughHole_Vias_Inner_poly() const noexcept
{ {
return m_through_inner_holes_vias_poly; return m_through_inner_holes_vias_poly;
} }
@ -345,43 +423,64 @@ class BOARD_ADAPTER
* @brief GetThroughHole_Inner - Get the ThroughHole container * @brief GetThroughHole_Inner - Get the ThroughHole container
* @return a container with holes * @return a container with holes
*/ */
const CBVHCONTAINER2D &GetThroughHole_Inner() const { return m_through_holes_inner; } const CBVHCONTAINER2D &GetThroughHole_Inner() const noexcept
{
return m_through_holes_inner;
}
/** /**
* @brief GetThroughHole_Inner_poly - * @brief GetThroughHole_Inner_poly -
* @return * @return
*/ */
const SHAPE_POLY_SET &GetThroughHole_Inner_poly() const { return m_through_inner_holes_poly; } const SHAPE_POLY_SET &GetThroughHole_Inner_poly() const noexcept
{
return m_through_inner_holes_poly;
}
/** /**
* @brief GetStats_Nr_Vias - Get statistics of the nr of vias * @brief GetStats_Nr_Vias - Get statistics of the nr of vias
* @return number of vias * @return number of vias
*/ */
unsigned int GetStats_Nr_Vias() const { return m_stats_nr_vias; } unsigned int GetStats_Nr_Vias() const noexcept
{
return m_stats_nr_vias;
}
/** /**
* @brief GetStats_Nr_Holes - Get statistics of the nr of holes * @brief GetStats_Nr_Holes - Get statistics of the nr of holes
* @return number of holes * @return number of holes
*/ */
unsigned int GetStats_Nr_Holes() const { return m_stats_nr_holes; } unsigned int GetStats_Nr_Holes() const noexcept
{
return m_stats_nr_holes;
}
/** /**
* @brief GetStats_Med_Via_Hole_Diameter3DU - Average diameter of the via holes * @brief GetStats_Med_Via_Hole_Diameter3DU - Average diameter of the via holes
* @return dimension in 3D units * @return dimension in 3D units
*/ */
float GetStats_Med_Via_Hole_Diameter3DU() const { return m_stats_via_med_hole_diameter; } float GetStats_Med_Via_Hole_Diameter3DU() const noexcept
{
return m_stats_via_med_hole_diameter;
}
/** /**
* @brief GetStats_Med_Hole_Diameter3DU - Average diameter of holes * @brief GetStats_Med_Hole_Diameter3DU - Average diameter of holes
* @return dimension in 3D units * @return dimension in 3D units
*/ */
float GetStats_Med_Hole_Diameter3DU() const { return m_stats_hole_med_diameter; } float GetStats_Med_Hole_Diameter3DU() const noexcept
{
return m_stats_hole_med_diameter;
}
/** /**
* @brief GetStats_Med_Track_Width - Average width of the tracks * @brief GetStats_Med_Track_Width - Average width of the tracks
* @return dimensions in 3D units * @return dimensions in 3D units
*/ */
float GetStats_Med_Track_Width() const { return m_stats_track_med_width; } float GetStats_Med_Track_Width() const noexcept
{
return m_stats_track_med_width;
}
/** /**
* @brief GetNrSegmentsCircle * @brief GetNrSegmentsCircle
@ -409,11 +508,20 @@ class BOARD_ADAPTER
* @brief GetPolyMap - Get maps of polygons's layers * @brief GetPolyMap - Get maps of polygons's layers
* @return the map with polygons's layers * @return the map with polygons's layers
*/ */
const MAP_POLY &GetPolyMap() const { return m_layers_poly; } const MAP_POLY &GetPolyMap() const noexcept
{
return m_layers_poly;
}
const MAP_POLY &GetPolyMapHoles_Inner() const { return m_layers_inner_holes_poly; } const MAP_POLY &GetPolyMapHoles_Inner() const noexcept
{
return m_layers_inner_holes_poly;
}
const MAP_POLY &GetPolyMapHoles_Outer() const { return m_layers_outer_holes_poly; } const MAP_POLY &GetPolyMapHoles_Outer() const noexcept
{
return m_layers_outer_holes_poly;
}
private: private:
/** /**

View File

@ -44,7 +44,7 @@ namespace S3D
* kicad_3dsg library * kicad_3dsg library
*/ */
SGLIB_API void GetLibVersion( unsigned char* Major, unsigned char* Minor, SGLIB_API void GetLibVersion( unsigned char* Major, unsigned char* Minor,
unsigned char* Patch, unsigned char* Revision ); unsigned char* Patch, unsigned char* Revision ) noexcept;
// functions to extract information from SGNODE pointers // functions to extract information from SGNODE pointers
SGLIB_API S3D::SGTYPES GetSGNodeType( SGNODE* aNode ); SGLIB_API S3D::SGTYPES GetSGNodeType( SGNODE* aNode );
@ -143,7 +143,7 @@ namespace S3D
* to safely delete an SG* node without associating the node with * to safely delete an SG* node without associating the node with
* its corresponding IFSG* wrapper. * its corresponding IFSG* wrapper.
*/ */
SGLIB_API void DestroyNode( SGNODE* aNode ); SGLIB_API void DestroyNode( SGNODE* aNode ) noexcept;
// NOTE: The following functions facilitate the creation and destruction // NOTE: The following functions facilitate the creation and destruction
// of data structures for rendering // of data structures for rendering

View File

@ -58,8 +58,8 @@ public:
bool SetAmbient( const SGCOLOR* aRGBColor ); bool SetAmbient( const SGCOLOR* aRGBColor );
bool SetAmbient( const SGCOLOR& aRGBColor ); bool SetAmbient( const SGCOLOR& aRGBColor );
bool SetShininess( float aShininess ); bool SetShininess( float aShininess ) noexcept;
bool SetTransparency( float aTransparency ); bool SetTransparency( float aTransparency ) noexcept;
}; };
#endif // IFSG_APPEARANCE_H #endif // IFSG_APPEARANCE_H

View File

@ -87,7 +87,7 @@ public:
* Function GetRawPtr() * Function GetRawPtr()
* returns the raw internal SGNODE pointer * returns the raw internal SGNODE pointer
*/ */
SGNODE* GetRawPtr( void ); SGNODE* GetRawPtr( void ) noexcept;
/** /**
* Function GetNodeType * Function GetNodeType

View File

@ -52,10 +52,10 @@ public:
bool SetScaleOrientation( const SGVECTOR& aScaleAxis, double aAngle ); bool SetScaleOrientation( const SGVECTOR& aScaleAxis, double aAngle );
bool SetRotation( const SGVECTOR& aRotationAxis, double aAngle ); bool SetRotation( const SGVECTOR& aRotationAxis, double aAngle );
bool SetScale( const SGPOINT& aScale ); bool SetScale( const SGPOINT& aScale ) noexcept;
bool SetScale( double aScale ); bool SetScale( double aScale );
bool SetCenter( const SGPOINT& aCenter ); bool SetCenter( const SGPOINT& aCenter ) noexcept;
bool SetTranslation( const SGPOINT& aTranslation ); bool SetTranslation( const SGPOINT& aTranslation ) noexcept;
}; };
#endif // IFSG_TRANSFORM_H #endif // IFSG_TRANSFORM_H

View File

@ -51,16 +51,16 @@ public:
SGCOLOR(); SGCOLOR();
SGCOLOR( float aRVal, float aGVal, float aBVal ); SGCOLOR( float aRVal, float aGVal, float aBVal );
void GetColor( float& aRedVal, float& aGreenVal, float& aBlueVal ) const; void GetColor( float& aRedVal, float& aGreenVal, float& aBlueVal ) const noexcept;
void GetColor( SGCOLOR& aColor ) const; void GetColor( SGCOLOR& aColor ) const noexcept;
void GetColor( SGCOLOR* aColor ) const; void GetColor( SGCOLOR* aColor ) const noexcept;
bool SetColor( float aRedVal, float aGreenVal, float aBlueVal ); bool SetColor( float aRedVal, float aGreenVal, float aBlueVal );
bool SetColor( const SGCOLOR& aColor ); bool SetColor( const SGCOLOR& aColor ) noexcept;
bool SetColor( const SGCOLOR* aColor ); bool SetColor( const SGCOLOR* aColor ) noexcept;
private: private:
bool checkRange( float aRedVal, float aGreenVal, float aBlueVal ) const; bool checkRange( float aRedVal, float aGreenVal, float aBlueVal ) const noexcept;
}; };
@ -73,21 +73,21 @@ public:
public: public:
SGPOINT(); SGPOINT();
SGPOINT( double aXVal, double aYVal, double aZVal ); SGPOINT( double aXVal, double aYVal, double aZVal ) noexcept;
void GetPoint( double& aXVal, double& aYVal, double& aZVal ); void GetPoint( double& aXVal, double& aYVal, double& aZVal ) noexcept;
void GetPoint( SGPOINT& aPoint ); void GetPoint( SGPOINT& aPoint ) noexcept;
void GetPoint( SGPOINT* aPoint ); void GetPoint( SGPOINT* aPoint ) noexcept;
void SetPoint( double aXVal, double aYVal, double aZVal ); void SetPoint( double aXVal, double aYVal, double aZVal ) noexcept;
void SetPoint( const SGPOINT& aPoint ); void SetPoint( const SGPOINT& aPoint ) noexcept;
}; };
class SGLIB_API SGVECTOR class SGLIB_API SGVECTOR
{ {
private: private:
void normalize( void ); void normalize( void ) noexcept;
double vx; double vx;
double vy; double vy;
@ -97,12 +97,12 @@ public:
SGVECTOR(); SGVECTOR();
SGVECTOR( double aXVal, double aYVal, double aZVal ); SGVECTOR( double aXVal, double aYVal, double aZVal );
void GetVector( double& aXVal, double& aYVal, double& aZVal ) const; void GetVector( double& aXVal, double& aYVal, double& aZVal ) const noexcept;
void SetVector( double aXVal, double aYVal, double aZVal ); void SetVector( double aXVal, double aYVal, double aZVal );
void SetVector( const SGVECTOR& aVector ); void SetVector( const SGVECTOR& aVector );
SGVECTOR& operator=( const SGVECTOR& source ); SGVECTOR& operator=( const SGVECTOR& source ) noexcept;
}; };