OpenStructure
Public Member Functions | Protected Member Functions
Primitive Class Reference

#include <primitives.hh>

Inherits GfxNode.

Inherited by Cuboid, and Quad.

Public Member Functions

void SetFill (const Color &color, bool fill=true)
 
void SetOutline (const Color &color, bool line=true, float width=1.0)
 
void SetFillColor (const Color &color)
 
void SetOutlineColor (const Color &color)
 
const ColorGetFillColor () const
 
const ColorGetOutlineColor () const
 
bool HasFill () const
 
bool HasOutline () const
 
float GetLineWidth () const
 
void SetLineWidth (float width)
 
- Public Member Functions inherited from GfxNode
 GfxNode (const String &name)
 
virtual ~GfxNode ()
 
virtual GfxNodeP Copy () const
 
virtual void DeepSwap (GfxNode &n)
 
virtual void RenderGL (RenderPass pass)
 
virtual void RenderPov (PovState &pov)
 
virtual void Export (Exporter *ex)
 
virtual void Apply (GfxNodeVisitor &v, GfxNodeVisitor::Stack st)
 
virtual int GetType () const
 
String GetName () const
 
void RemoveAll ()
 
void Rename (const String &name)
 
void Add (GfxObjP obj)
 
bool IsNameAvailable (const String &name) const
 
void Remove (GfxObjP obj)
 
void Add (GfxNodeP node)
 
void Remove (GfxNodeP node)
 
void Remove (const String &name)
 
size_t GetChildCount () const
 
void Hide ()
 
void Show ()
 
bool IsVisible () const
 
virtual void ContextSwitch ()
 
bool IsAttachedToScene () const
 
gfx::GfxNodeP GetParent () const
 
const GfxNodeVectorGetChildren () const
 
GfxNodeVectorGetChildren ()
 

Protected Member Functions

 Primitive (const String &name)
 

Detailed Description

base class for geometric primitives such as cuboids, and circles

The geometric primitives support rendering in both outline and solid mode. These properties are controllable with SetFill() and SetOutline() as well as SetFillColor() and SetOutlineColor(). The line width can be adjusted with SetLineWidth().

See also
gfx::Cuboid, gfx::Quad
Todo:
transparent primitives would require the gfx objects to be ordered back to front. This has to be properly implemented in the rendering system.

Definition at line 43 of file primitives.hh.

Constructor & Destructor Documentation

◆ Primitive()

Primitive ( const String name)
protected

Member Function Documentation

◆ GetFillColor()

const Color& GetFillColor ( ) const

◆ GetLineWidth()

float GetLineWidth ( ) const

◆ GetOutlineColor()

const Color& GetOutlineColor ( ) const

◆ HasFill()

bool HasFill ( ) const

◆ HasOutline()

bool HasOutline ( ) const

◆ SetFill()

void SetFill ( const Color color,
bool  fill = true 
)

◆ SetFillColor()

void SetFillColor ( const Color color)

◆ SetLineWidth()

void SetLineWidth ( float  width)

◆ SetOutline()

void SetOutline ( const Color color,
bool  line = true,
float  width = 1.0 
)

◆ SetOutlineColor()

void SetOutlineColor ( const Color color)

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