Tulip 5.7.1
Large graphs analysis and drawing
Loading...
Searching...
No Matches
tlp::GlBox Class Reference

#include <GlBox.h>

+ Inheritance diagram for tlp::GlBox:
+ Collaboration diagram for tlp::GlBox:

Public Member Functions

 GlBox ()
 
 GlBox (const Coord &position, const Size &size, const Color &fillColor, const Color &outlineColor, bool filled=true, bool outlined=true, const std::string &textureName="", float outlineSize=1.)
 
 ~GlBox () override
 
void draw (float lod, Camera *camera) override
 
Color getFillColor () const
 
Color getOutlineColor () const
 
float getOutlineSize () const
 
Coord * getPosition () const
 
Size getSize () const
 
std::string getTextureName () const
 
void getXML (std::string &outString) override
 
void setFillColor (const Color &color)
 
void setOutlineColor (const Color &color)
 
void setOutlineSize (float size)
 
void setPosition (const Coord &position)
 
void setSize (const Size &size)
 
void setTextureName (const std::string &textureName)
 
void setWithXML (const std::string &inString, unsigned int &currentPosition) override
 
void translate (const Coord &mouvement) override
 
- Public Member Functions inherited from tlp::GlSimpleEntity
 GlSimpleEntity ()
 
 ~GlSimpleEntity () override
 
virtual void draw (float lod, Camera *camera)=0
 
virtual BoundingBox getBoundingBox ()
 
int getStencil ()
 
virtual void getXML (std::string &outString)=0
 
bool isVisible () const
 
virtual void setStencil (int stencil)
 
virtual void setVisible (bool visible)
 
virtual void setWithXML (const std::string &inString, unsigned int &currentPosition)=0
 

Static Public Member Functions

static void draw (const Color &fillColor, const Color &outlineColor, float outlineWidth, const std::string &textureName, float lod)
 
static Coord getAnchor (const Coord &vector)
 

Protected Member Functions

virtual void clearGenerated ()
 

Protected Attributes

GLuint buffers [5]
 
std::vector< Color > fillColors
 
bool filled
 
bool generated
 
float * newCubeCoordArrays
 
std::vector< Color > outlineColors
 
bool outlined
 
float outlineSize
 
Coord position
 
Size size
 
std::string textureName
 
- Protected Attributes inherited from tlp::GlSimpleEntity
BoundingBox boundingBox
 
std::vector< GlComposite * > parents
 
int stencil
 
bool visible
 

Detailed Description

General class used to render boxes as GlSimpleEntity.

Definition at line 35 of file GlBox.h.

Constructor & Destructor Documentation

◆ GlBox() [1/2]

tlp::GlBox::GlBox ( )

Don't use this constructor.

◆ GlBox() [2/2]

tlp::GlBox::GlBox ( const Coord &  position,
const Size &  size,
const Color &  fillColor,
const Color &  outlineColor,
bool  filled = true,
bool  outlined = true,
const std::string &  textureName = "",
float  outlineSize = 1. 
)

Constructor.

Parameters
positionThe center of the box.
sizeThe length of each dimension of the box.
fillColorThe fill color of the box.
outlineColorThe outline color of the box
filledFill the box ?
outlinedoutline the box ?
outlineSizeThe size of the outline

◆ ~GlBox()

tlp::GlBox::~GlBox ( )
override

Destructor.

Member Function Documentation

◆ draw() [1/2]

static void tlp::GlBox::draw ( const Color &  fillColor,
const Color &  outlineColor,
float  outlineWidth,
const std::string &  textureName,
float  lod 
)
static

Draw a GlBox.

◆ draw() [2/2]

void tlp::GlBox::draw ( float  lod,
Camera camera 
)
overridevirtual

Draw function.

Warning
You don't have to call this function, the Tulip OpenGL engine call it.

Implements tlp::GlSimpleEntity.

◆ getFillColor()

Color tlp::GlBox::getFillColor ( ) const

Accessor in reading to the fill color.

◆ getOutlineColor()

Color tlp::GlBox::getOutlineColor ( ) const

Accessor in reading to the outline color.

◆ getOutlineSize()

float tlp::GlBox::getOutlineSize ( ) const

Accessor in reading to the outline size.

◆ getPosition()

Coord * tlp::GlBox::getPosition ( ) const

Accessor in reading to the position.

◆ getSize()

Size tlp::GlBox::getSize ( ) const

Accessor in reading to the size.

◆ getTextureName()

std::string tlp::GlBox::getTextureName ( ) const

Accessor in reading to the texture name.

◆ getXML()

void tlp::GlBox::getXML ( std::string &  outString)
overridevirtual

Function to export data in outString (in XML format)

Implements tlp::GlSimpleEntity.

◆ setFillColor()

void tlp::GlBox::setFillColor ( const Color &  color)

Accessor in writing to the fill color of the box.

◆ setOutlineColor()

void tlp::GlBox::setOutlineColor ( const Color &  color)

Accessor in writing to the outline color of the box.

◆ setOutlineSize()

void tlp::GlBox::setOutlineSize ( float  size)

Accessor in writing to the outline size of the box.

◆ setPosition()

void tlp::GlBox::setPosition ( const Coord &  position)

Accessor in writing to the position.

◆ setSize()

void tlp::GlBox::setSize ( const Size &  size)

Accessor in writing to the size of the box.

◆ setTextureName()

void tlp::GlBox::setTextureName ( const std::string &  textureName)

Accessor in writing to the texture name of the box.

◆ setWithXML()

void tlp::GlBox::setWithXML ( const std::string &  inString,
unsigned int &  currentPosition 
)
overridevirtual

Function to set data with inString (in XML format)

Implements tlp::GlSimpleEntity.

◆ translate()

void tlp::GlBox::translate ( const Coord &  mouvement)
override

Translate entity.

Member Data Documentation

◆ buffers

GLuint tlp::GlBox::buffers[5]
protected

Definition at line 162 of file GlBox.h.

◆ fillColors

std::vector<Color> tlp::GlBox::fillColors
protected

fillColor of the box

Definition at line 153 of file GlBox.h.

◆ filled

bool tlp::GlBox::filled
protected

the box is filled ?

Definition at line 155 of file GlBox.h.

◆ generated

bool tlp::GlBox::generated
protected

Definition at line 161 of file GlBox.h.

◆ newCubeCoordArrays

float* tlp::GlBox::newCubeCoordArrays
protected

Definition at line 160 of file GlBox.h.

◆ outlineColors

std::vector<Color> tlp::GlBox::outlineColors
protected

outlineColor of the box

Definition at line 154 of file GlBox.h.

◆ outlined

bool tlp::GlBox::outlined
protected

the box is outlined ?

Definition at line 156 of file GlBox.h.

◆ outlineSize

float tlp::GlBox::outlineSize
protected

size of the ouline

Definition at line 158 of file GlBox.h.

◆ position

Coord tlp::GlBox::position
protected

The position of the center of the box

Definition at line 151 of file GlBox.h.

◆ size

Size tlp::GlBox::size
protected

size is the "radius" of the box

Definition at line 152 of file GlBox.h.

◆ textureName

std::string tlp::GlBox::textureName
protected

Definition at line 157 of file GlBox.h.