KiCad PCB EDA Suite
COBJECT Class Referenceabstract

#include <cobject.h>

Inheritance diagram for COBJECT:
CDUMMYBLOCK CLAYERITEM CROUNDSEG CTRIANGLE CVCYLINDER CXYPLANE

Public Member Functions

 COBJECT (OBJECT3D_TYPE aObjType)
 
void SetMaterial (const CMATERIAL *aMaterial)
 
const CMATERIALGetMaterial () const
 
virtual SFVEC3F GetDiffuseColor (const HITINFO &aHitInfo) const =0
 
virtual ~COBJECT ()
 
virtual bool Intersects (const CBBOX &aBBox) const =0
 Function Intersects. More...
 
virtual bool Intersect (const RAY &aRay, HITINFO &aHitInfo) const =0
 Functions Intersect. More...
 
virtual bool IntersectP (const RAY &aRay, float aMaxDistance) const =0
 Functions Intersect for shadow test. More...
 
const CBBOXGetBBox () const
 
const SFVEC3FGetCentroid () const
 

Protected Attributes

CBBOX m_bbox
 
SFVEC3F m_centroid
 
OBJECT3D_TYPE m_obj_type
 
const CMATERIALm_material
 

Detailed Description

Definition at line 50 of file cobject.h.

Constructor & Destructor Documentation

COBJECT::COBJECT ( OBJECT3D_TYPE  aObjType)
explicit

Definition at line 38 of file cobject.cpp.

References COBJECT3D_STATS::AddOne(), COBJECT3D_STATS::Instance(), m_material, m_obj_type, and s_defaultMaterial.

39 {
40  m_obj_type = aObjType;
41  COBJECT3D_STATS::Instance().AddOne( aObjType );
43 }
OBJECT3D_TYPE m_obj_type
Definition: cobject.h:55
const CMATERIAL * m_material
Definition: cobject.h:56
void AddOne(OBJECT3D_TYPE aObjType)
Definition: cobject.h:112
static const CBLINN_PHONG_MATERIAL s_defaultMaterial
Definition: cobject.cpp:36
static COBJECT3D_STATS & Instance()
Definition: cobject.h:116
virtual COBJECT::~COBJECT ( )
inlinevirtual

Definition at line 67 of file cobject.h.

67 {}

Member Function Documentation

const CBBOX& COBJECT::GetBBox ( ) const
inline

Definition at line 94 of file cobject.h.

References m_bbox.

Referenced by CGENERICCONTAINER::Add(), and CBVH_PBRT::Intersect().

94 { return m_bbox; }
CBBOX m_bbox
Definition: cobject.h:53
const SFVEC3F& COBJECT::GetCentroid ( ) const
inline

Definition at line 96 of file cobject.h.

References m_centroid.

96 { return m_centroid; }
SFVEC3F m_centroid
Definition: cobject.h:54
virtual SFVEC3F COBJECT::GetDiffuseColor ( const HITINFO aHitInfo) const
pure virtual
const CMATERIAL* COBJECT::GetMaterial ( ) const
inline

Definition at line 63 of file cobject.h.

References m_material.

Referenced by CBVH_PBRT::IntersectP(), and C3D_RENDER_RAYTRACING::shadeHit().

63 { return m_material; }
const CMATERIAL * m_material
Definition: cobject.h:56
virtual bool COBJECT::Intersect ( const RAY aRay,
HITINFO aHitInfo 
) const
pure virtual

Functions Intersect.

Intersect

Parameters
aRay
aHitInfo
Returns
TRUE if the aRay intersects the object

Implemented in CTRIANGLE, CXYPLANE, CVCYLINDER, CROUNDSEG, CLAYERITEM, and CDUMMYBLOCK.

Referenced by CCONTAINER::Intersect(), CBVH_PBRT::Intersect(), and C3D_RENDER_RAYTRACING::render_preview().

virtual bool COBJECT::IntersectP ( const RAY aRay,
float  aMaxDistance 
) const
pure virtual

Functions Intersect for shadow test.

Intersect

Parameters
aRay
aDistance- max distance of the test
Returns
TRUE if the aRay intersects the object

Implemented in CTRIANGLE, CXYPLANE, CVCYLINDER, CROUNDSEG, CLAYERITEM, and CDUMMYBLOCK.

Referenced by CCONTAINER::IntersectP(), and CBVH_PBRT::IntersectP().

virtual bool COBJECT::Intersects ( const CBBOX aBBox) const
pure virtual

Function Intersects.

Intersects - a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅) It intersects if the result intersection is not null

Parameters
aBBox
Returns

Implemented in CTRIANGLE, CXYPLANE, CVCYLINDER, CROUNDSEG, CLAYERITEM, and CDUMMYBLOCK.

void COBJECT::SetMaterial ( const CMATERIAL aMaterial)
inline

Member Data Documentation

OBJECT3D_TYPE COBJECT::m_obj_type
protected

Definition at line 55 of file cobject.h.

Referenced by COBJECT().


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