Privacy
An open-source, flexible 3D physical simulation framework
mars::graphics::OSGDrawItem Class Reference

Wraps draw_item in osg::Group. More...

#include <OSGDrawItem.h>

Public Member Functions

 OSGDrawItem (GraphicsWidget *gw)
 Constructor, does not create geometry. More...
 
 OSGDrawItem (GraphicsWidget *gw, const interfaces::draw_item &di, std::string font_path)
 Constructor, creates geometry from draw_item instance. More...
 
void update (interfaces::draw_item &di)
 update this OSGDrawItem with given draw_item instance. More...
 
GraphicsWidgetgw ()
 

Static Public Member Functions

static void createLabel (OSGDrawItem *di, mars::utils::Vector pos, mars::interfaces::sReal size, std::string label, std::string fontPath, double r=1.0, double g=1.0, double b=1.0, double a=1.0, int align_to_view=1)
 
static void updateLabel (OSGDrawItem *di, mars::utils::Vector pos, mars::interfaces::sReal size, std::string label, double r, double g, double b, double a, int align_to_view)
 
static void createLine (OSGDrawItem *di, mars::utils::Vector start, mars::utils::Vector end, mars::utils::Color myColor)
 
static void createLines (OSGDrawItem *osgNode, std::vector< float > _vertices, mars::utils::Color myColor)
 
static void createArrow (OSGDrawItem *di, mars::utils::Vector start, mars::utils::Vector end, mars::utils::Color myColor)
 creates an arrow between start and end directed to "end" More...
 
static void createRectangle (OSGDrawItem *di, mars::utils::Vector a, mars::utils::Vector b, mars::utils::Vector q, mars::utils::Color myColor, mars::utils::Color borderColor, int align_to_view=0)
 
static void createCircle (OSGDrawItem *di, mars::utils::Vector a, mars::utils::Vector b, mars::utils::Vector q, mars::utils::Color myColor, mars::utils::Color borderColor, int resolution)
 
static void createHUDRectangle (OSGDrawItem *di, mars::interfaces::sReal height, mars::interfaces::sReal width, mars::utils::Vector myoff, mars::utils::Color myColor)
 
static void updateHUDRectangle (OSGDrawItem *di, mars::interfaces::sReal height, mars::interfaces::sReal width, mars::utils::Vector myoff, mars::utils::Color myColor)
 
static void createPoints (OSGDrawItem *di, std::vector< float > vertices, mars::utils::Color myColor)
 
static void updatePoints (OSGDrawItem *di, std::vector< float > vertices)
 
static void createTriangleSet (OSGDrawItem *di, std::vector< float > vertices, mars::utils::Color myColor)
 
static void updateTriangleSet (OSGDrawItem *di, std::vector< float > vertices)
 
static void addToTriangleSet (OSGDrawItem *di, std::vector< float > vertices, mars::utils::Color myColor)
 
static void createPlane (OSGDrawItem *di, double w, double l, double h, double res)
 
static void createSphere (OSGDrawItem *di, double rad)
 

Private Attributes

interfaces::DrawType type_
 
GraphicsWidgetgw_
 
osg::ref_ptr< osg::Texture2D > texture_
 

Detailed Description

Wraps draw_item in osg::Group.

Definition at line 49 of file OSGDrawItem.h.

Constructor & Destructor Documentation

◆ OSGDrawItem() [1/2]

mars::graphics::OSGDrawItem::OSGDrawItem ( GraphicsWidget gw)

Constructor, does not create geometry.

Definition at line 53 of file OSGDrawItem.cpp.

◆ OSGDrawItem() [2/2]

mars::graphics::OSGDrawItem::OSGDrawItem ( GraphicsWidget gw,
const interfaces::draw_item di,
std::string  font_path 
)

Constructor, creates geometry from draw_item instance.

Definition at line 58 of file OSGDrawItem.cpp.

Member Function Documentation

◆ addToTriangleSet()

void mars::graphics::OSGDrawItem::addToTriangleSet ( OSGDrawItem di,
std::vector< float >  vertices,
mars::utils::Color  myColor 
)
static

Definition at line 360 of file OSGDrawItem.cpp.

◆ createArrow()

void mars::graphics::OSGDrawItem::createArrow ( OSGDrawItem di,
mars::utils::Vector  start,
mars::utils::Vector  end,
mars::utils::Color  myColor 
)
static

creates an arrow between start and end directed to "end"

Definition at line 244 of file OSGDrawItem.cpp.

◆ createCircle()

void mars::graphics::OSGDrawItem::createCircle ( OSGDrawItem di,
mars::utils::Vector  a,
mars::utils::Vector  b,
mars::utils::Vector  q,
mars::utils::Color  myColor,
mars::utils::Color  borderColor,
int  resolution 
)
static

Definition at line 486 of file OSGDrawItem.cpp.

◆ createHUDRectangle()

void mars::graphics::OSGDrawItem::createHUDRectangle ( OSGDrawItem di,
mars::interfaces::sReal  height,
mars::interfaces::sReal  width,
mars::utils::Vector  myoff,
mars::utils::Color  myColor 
)
static

Definition at line 545 of file OSGDrawItem.cpp.

◆ createLabel()

void mars::graphics::OSGDrawItem::createLabel ( OSGDrawItem di,
mars::utils::Vector  pos,
mars::interfaces::sReal  size,
std::string  label,
std::string  fontPath,
double  r = 1.0,
double  g = 1.0,
double  b = 1.0,
double  a = 1.0,
int  align_to_view = 1 
)
static

Definition at line 637 of file OSGDrawItem.cpp.

◆ createLine()

void mars::graphics::OSGDrawItem::createLine ( OSGDrawItem di,
mars::utils::Vector  start,
mars::utils::Vector  end,
mars::utils::Color  myColor 
)
static

Definition at line 272 of file OSGDrawItem.cpp.

◆ createLines()

void mars::graphics::OSGDrawItem::createLines ( OSGDrawItem osgNode,
std::vector< float >  _vertices,
mars::utils::Color  myColor 
)
static

Definition at line 299 of file OSGDrawItem.cpp.

◆ createPlane()

void mars::graphics::OSGDrawItem::createPlane ( OSGDrawItem di,
double  w,
double  l,
double  h,
double  res 
)
static

Definition at line 689 of file OSGDrawItem.cpp.

◆ createPoints()

void mars::graphics::OSGDrawItem::createPoints ( OSGDrawItem di,
std::vector< float >  vertices,
mars::utils::Color  myColor 
)
static

Definition at line 732 of file OSGDrawItem.cpp.

◆ createRectangle()

void mars::graphics::OSGDrawItem::createRectangle ( OSGDrawItem di,
mars::utils::Vector  a,
mars::utils::Vector  b,
mars::utils::Vector  q,
mars::utils::Color  myColor,
mars::utils::Color  borderColor,
int  align_to_view = 0 
)
static

Definition at line 416 of file OSGDrawItem.cpp.

◆ createSphere()

void mars::graphics::OSGDrawItem::createSphere ( OSGDrawItem di,
double  rad 
)
static

Definition at line 224 of file OSGDrawItem.cpp.

◆ createTriangleSet()

void mars::graphics::OSGDrawItem::createTriangleSet ( OSGDrawItem di,
std::vector< float >  vertices,
mars::utils::Color  myColor 
)
static

Definition at line 330 of file OSGDrawItem.cpp.

◆ gw()

GraphicsWidget* mars::graphics::OSGDrawItem::gw ( )
inline

Definition at line 140 of file OSGDrawItem.h.

◆ update()

void mars::graphics::OSGDrawItem::update ( interfaces::draw_item di)

update this OSGDrawItem with given draw_item instance.

Definition at line 171 of file OSGDrawItem.cpp.

◆ updateHUDRectangle()

void mars::graphics::OSGDrawItem::updateHUDRectangle ( OSGDrawItem di,
mars::interfaces::sReal  height,
mars::interfaces::sReal  width,
mars::utils::Vector  myoff,
mars::utils::Color  myColor 
)
static

Definition at line 597 of file OSGDrawItem.cpp.

◆ updateLabel()

void mars::graphics::OSGDrawItem::updateLabel ( OSGDrawItem di,
mars::utils::Vector  pos,
mars::interfaces::sReal  size,
std::string  label,
double  r,
double  g,
double  b,
double  a,
int  align_to_view 
)
static

Definition at line 671 of file OSGDrawItem.cpp.

◆ updatePoints()

void mars::graphics::OSGDrawItem::updatePoints ( OSGDrawItem di,
std::vector< float >  vertices 
)
static

Definition at line 761 of file OSGDrawItem.cpp.

◆ updateTriangleSet()

void mars::graphics::OSGDrawItem::updateTriangleSet ( OSGDrawItem di,
std::vector< float >  vertices 
)
static

Definition at line 396 of file OSGDrawItem.cpp.

Member Data Documentation

◆ gw_

GraphicsWidget* mars::graphics::OSGDrawItem::gw_
private

Definition at line 146 of file OSGDrawItem.h.

◆ texture_

osg::ref_ptr<osg::Texture2D> mars::graphics::OSGDrawItem::texture_
private

Definition at line 147 of file OSGDrawItem.h.

◆ type_

interfaces::DrawType mars::graphics::OSGDrawItem::type_
private

Definition at line 145 of file OSGDrawItem.h.


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