Kigs Framework  Doc version 0.8
Open source multi purpose Rapid Application Development framework
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SimpleDrawing Class Referenceabstract

#include <SimpleDrawing.h>

Inheritance diagram for SimpleDrawing:
Drawable SceneNode CoreModifiable GenericRefCountedBaseClass

Public Member Functions

virtual ~SimpleDrawing ()
 destructor
 
bool Draw (TravState *travstate) override=0
 initialise draw method More...
 
bool BBoxUpdate (kdouble) override
 update the bounding box More...
 
void setColor (kfloat R, kfloat G, kfloat B)
 set the color More...
 
void setAlpha (kfloat A)
 set the alpha value More...
 
void setColor (kfloat R, kfloat G, kfloat B, kfloat A)
 set the color More...
 
void setVertex (int index, Point3D Position)
 add a vertex in the vertice list at the specified index More...
 
void setVertexArray (Point3D *Position, int Count)
 set the vertice list (cler the old vertice list if not null) More...
 
void setToRectangle (const kfloat &w, const kfloat &h, bool bWire, char cNormal='X')
 set the SimpleDrawing as a rectangle More...
 
void setToBox (const kfloat &w, const kfloat &h, const kfloat &d, bool bWire)
 set the SimpleDrawing as a box More...
 
void setToDisk (const kfloat &r, const int &precision, bool bWire, char cNormal='X')
 set the SimpleDrawing as a disk (with (0,0,0) as center) More...
 
- Public Member Functions inherited from Drawable
virtual void DoPreDraw (TravState *)
 pre draw method More...
 
virtual void DoDraw (TravState *travstate)
 draw method More...
 
virtual void DoPostDraw (TravState *travstate)
 post draw method More...
 
void CheckPostDraw (TravState *travstate)
 check before calling corresponding DoPredraw More...
 
bool addItem (const CMSP &item, ItemPosition pos=Last) override
 add item in scene tree More...
 
bool removeItem (const CMSP &item) override
 remove item in scene tree More...
 
virtual void GetGlobalPosition (Matrix3x4 *pLocalToGlobal, kfloat &x, kfloat &y, kfloat &z)
 get the global position of the drawable More...
 
- Public Member Functions inherited from SceneNode
bool addItem (const CMSP &item, ItemPosition pos=Last DECLARE_DEFAULT_LINK_NAME) override
 add item at first or last position
 
- Public Member Functions inherited from CoreModifiable
void Init ()
 Modifiable managmenent.
 
void EmptyItemList ()
 remove all items (sons)
 
CMSP GetInstanceByPath (const std::string &path)
 return the instance corresponding to the given path in sons tree
 
std::string GetRuntimeID () const
 ID.
 
CoreModifiableAttributegetAttribute (KigsID labelid) const
 Attribute management.
 
u32 getNbArrayElements (KigsID attributeLabel) const
 return element count for an array type attribute
 
template<typename attribute_type , typename value_type >
attribute_type * AddDynamicAttribute (KigsID ID, const value_type &value)
 Dynamic attribute management.
 
const kigs::unordered_map< KigsID, ModifiableMethodStruct > * GetMethods ()
 Method management.
 
bool aggregateWith (CMSP &item, ItemPosition pos=Last)
 Aggregate management.
 
void flagAsNotificationCenterRegistered ()
 Flags.
 
void InitParametersFromList (const std::vector< CoreModifiableAttribute * > *params)
 Utility. More...
 
virtual void UninitModifiable ()
 called when InitModifiable has failled : reset read/write flag on all init params More...
 
virtual void ProtectedDestroy ()
 Destroy method decrement refcounter and delete instance if no more used. More...
 
virtual void addUser (CoreModifiable *user)
 add the given parent to list
 
virtual void removeUser (CoreModifiable *user)
 remove user (parent)
 

Protected Member Functions

virtual void PrepareDrawing ()=0
 prepare the drawing
 
- Protected Member Functions inherited from Drawable
void InitModifiable () override
 init the modifiable and set the _isInit flag to true if OK
 
virtual bool PreDraw (TravState *)
 initialise pre draw method More...
 
virtual bool PostDraw (TravState *)
 initialise PostDraw method More...
 
virtual void FatherNode3DNeedBoundingBoxUpdate ()
 update the father node bounding box
 
- Protected Member Functions inherited from CoreModifiable
void UpdateAggregates (const Timer &timer, void *addParam)
 Internals.
 
void Export (std::vector< CoreModifiable * > &savedList, XMLNode *currentNode, bool recursive, ExportSettings *settings)
 Export. More...
 
CoreModifiableAttributeGenericCreateDynamicAttribute (CoreModifiable::ATTRIBUTE_TYPE type, KigsID ID)
 create and add dynamic attribute except arrays
 

Protected Attributes

Point3D * mVertex = nullptr
 list of vertice
 
int mVertexCount = 0
 number of vertice
 
maInt mMode = BASE_ATTRIBUTE(Mode, 0)
 drawing mode
 
maFloat mWidth = BASE_ATTRIBUTE(Width, 1)
 width
 
maFloat mAlpha = BASE_ATTRIBUTE(Alpha, 1)
 alpha value
 
maVect3DF mColor = BASE_ATTRIBUTE(Color, 1, 1, 1)
 color value
 

Additional Inherited Members

- Static Public Member Functions inherited from CoreModifiable
static std::vector< CMSP > GetRootInstances (const KigsID &cid, bool exactTypeOnly=false)
 static method : return the set of all root instances of the given type
 
static void Append (std::string &XMLString, const std::list< CoreModifiable * > &toexport, bool recursive, ExportSettings *settings=nullptr)
 static method to export the several CoreModifiable to an XML file. if recursive flag is set to true, export also all sons tree More...
 
static void Export (const std::string &filename, CoreModifiable *toexport, bool recursive=false, ExportSettings *settings=nullptr)
 static method to export the given CoreModifiable to an XML file. if recursive flag is set to true, export also all sons tree More...
 
static XMLNodeExportToXMLNode (CoreModifiable *toexport, XML *owner_xml_file, bool recursive, ExportSettings *settings=nullptr)
 static method to export the given CoreModifiable to an XML Node. if recursive flag is set to true, export also all sons tree More...
 
static std::string ExportToXMLString (CoreModifiable *toexport, bool recursive, ExportSettings *settings=nullptr)
 static method to export the given CoreModifiable to an XML file. if recursive flag is set to true, export also all sons tree More...
 
static void Export (std::string &XMLString, const std::list< CoreModifiable * > &toexport, bool recursive, ExportSettings *settings=nullptr)
 static method to export the several CoreModifiable to an XML file. if recursive flag is set to true, export also all sons tree More...
 
static CMSP Import (const std::string &filename, bool noInit=false, bool keepImportFileName=false, ImportState *state=nullptr, const std::string &override_name="")
 return an new CoreModifiable instance using the description found in XML file given by name
 
static CMSP GetInstanceByGlobalPath (const std::string &path)
 static method : return the instance corresponding to the given path, and given search start
 
static void debugPrintfFullTree (int maxindent=3)
 Editor. More...
 
- Static Protected Member Functions inherited from CoreModifiable
template<typename StringType >
static CMSP Import (XMLNodeTemplate< StringType > *currentNode, CoreModifiable *currentModifiable, ImportState &importState)
 recusrive method to add sons and attributes found in the XML file
 

Detailed Description

draw simple objects...

Probably obsolete or same usage as DrawVertice / DirectRenderingMethods.

Member Function Documentation

◆ BBoxUpdate()

bool SimpleDrawing::BBoxUpdate ( kdouble  )
inlineoverridevirtual

update the bounding box

Parameters
kdouble: world time
Returns
TRUE because has a bounding box

Reimplemented from Drawable.

◆ Draw()

bool SimpleDrawing::Draw ( TravState travstate)
overridepure virtual

initialise draw method

Parameters
travstate: camera state
Returns
TRUE if a could draw

Reimplemented from Drawable.

◆ setAlpha()

void SimpleDrawing::setAlpha ( kfloat  A)

set the alpha value

Parameters
A: alpha value (0 to 1)

◆ setColor() [1/2]

void SimpleDrawing::setColor ( kfloat  R,
kfloat  G,
kfloat  B 
)

set the color

Parameters
R: red value (0 to 1)
G: green value (0 to 1)
B: blue value (0 to 1)

◆ setColor() [2/2]

void SimpleDrawing::setColor ( kfloat  R,
kfloat  G,
kfloat  B,
kfloat  A 
)

set the color

Parameters
R: red value (0 to 1)
G: green value (0 to 1)
B: blue value (0 to 1)
A: alpha value (0 to 1)

◆ setToBox()

void SimpleDrawing::setToBox ( const kfloat &  w,
const kfloat &  h,
const kfloat &  d,
bool  bWire 
)

set the SimpleDrawing as a box

Parameters
w: width of the rectangle
h: height of the rectangle
d: depth of the rectangle
bWire: draw in wire or plain mode

◆ setToDisk()

void SimpleDrawing::setToDisk ( const kfloat &  r,
const int &  precision,
bool  bWire,
char  cNormal = 'X' 
)

set the SimpleDrawing as a disk (with (0,0,0) as center)

Parameters
r: size of the disk
precision: precision of the disk
bWire: draw in wire or plain mode
cNormal: orientation of the disk

type of cNormal :

  • X : normal : +X axis (1,0,0)
  • x : normal : -X axis (-1,0,0)
  • Y : normal : -Y axis (0,1,0)
  • y : normal : -Y axis (0,-1,0)
  • Z : normal : -Z axis (0,0,1)
  • z : normal : -Z axis (0,0,-1)

◆ setToRectangle()

void SimpleDrawing::setToRectangle ( const kfloat &  w,
const kfloat &  h,
bool  bWire,
char  cNormal = 'X' 
)

set the SimpleDrawing as a rectangle

Parameters
w: width of the rectangle
h: height of the rectangle
bWire: draw in wire or plain mode
cNormal: orientation of the rectangle

type of cNormal :

  • X : normal : +X axis (1,0,0)
  • x : normal : -X axis (-1,0,0)
  • Y : normal : -Y axis (0,1,0)
  • y : normal : -Y axis (0,-1,0)
  • Z : normal : -Z axis (0,0,1)
  • z : normal : -Z axis (0,0,-1)

◆ setVertex()

void SimpleDrawing::setVertex ( int  index,
Point3D  Position 
)

add a vertex in the vertice list at the specified index

Parameters
index: index of the vertex
Position: vertex to add

◆ setVertexArray()

void SimpleDrawing::setVertexArray ( Point3D *  Position,
int  Count 
)

set the vertice list (cler the old vertice list if not null)

Parameters
Position: new vertice list
Count: number of the vertice

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