INET Framework for OMNeT++/OMNEST
inet::CanvasProjection Class Reference

#include <CanvasProjection.h>

Public Member Functions

 CanvasProjection ()
 
 CanvasProjection (Rotation rotation, cFigure::Point translation)
 
const RotationgetRotation () const
 
void setRotation (const Rotation &rotation)
 
const cFigure::Point & getScale () const
 
void setScale (const cFigure::Point &scale)
 
const cFigure::Point & getTranslation () const
 
void setTranslation (const cFigure::Point &translation)
 
cFigure::Point computeCanvasPoint (const Coord &point) const
 

Static Public Member Functions

static const CanvasProjectiongetCanvasProjection (const cCanvas *canvas)
 
static void setCanvasProjection (const cCanvas *canvas, const CanvasProjection *canvasProjection)
 

Protected Attributes

Rotation rotation
 
cFigure::Point scale
 
cFigure::Point translation
 

Static Protected Attributes

static CanvasProjection defaultCanvasProjection
 
static std::map< const cCanvas *, const CanvasProjection * > canvasProjections
 

Constructor & Destructor Documentation

inet::CanvasProjection::CanvasProjection ( )
inline
36 : scale(cFigure::Point(1, 1)) {}
cFigure::Point scale
Definition: CanvasProjection.h:29
inet::CanvasProjection::CanvasProjection ( Rotation  rotation,
cFigure::Point  translation 
)
25  :
27  scale(cFigure::Point(1, 1)),
29 {
30 }
Rotation rotation
Definition: CanvasProjection.h:28
cFigure::Point translation
Definition: CanvasProjection.h:30
cFigure::Point scale
Definition: CanvasProjection.h:29

Member Function Documentation

cFigure::Point inet::CanvasProjection::computeCanvasPoint ( const Coord point) const

Referenced by inet::visualizer::PhysicalEnvironmentCanvasVisualizer::computeFacePoints(), inet::visualizer::LinkBreakCanvasVisualizer::createLinkBreakVisualization(), inet::visualizer::NetworkConnectionCanvasVisualizer::createNetworkConnectionVisualization(), inet::visualizer::TracingObstacleLossCanvasVisualizer::createObstacleLossVisualization(), inet::visualizer::PacketDropCanvasVisualizer::createPacketDropVisualization(), inet::visualizer::MediumCanvasVisualizer::createSignalFigure(), inet::visualizer::MediumCanvasVisualizer::initialize(), inet::visualizer::SceneCanvasVisualizer::initializeAxis(), inet::visualizer::NetworkNodeCanvasVisualizer::refreshDisplay(), inet::visualizer::LinkBreakCanvasVisualizer::refreshDisplay(), inet::visualizer::RoutingTableCanvasVisualizer::refreshDisplay(), inet::visualizer::PathCanvasVisualizerBase::refreshDisplay(), inet::visualizer::LinkCanvasVisualizerBase::refreshDisplay(), inet::visualizer::MobilityCanvasVisualizer::refreshDisplay(), inet::visualizer::PhysicalEnvironmentCanvasVisualizer::refreshDisplay(), inet::visualizer::MediumCanvasVisualizer::refreshSignalFigure(), inet::visualizer::PacketDropCanvasVisualizer::setAlpha(), and inet::MobilityBase::updateVisualRepresentation().

33 {
34  Coord rotatedPoint = rotation.rotateVectorClockwise(point);
35  return cFigure::Point(rotatedPoint.x * scale.x + translation.x, rotatedPoint.y * scale.y + translation.y);
36 }
Rotation rotation
Definition: CanvasProjection.h:28
Coord rotateVectorClockwise(const Coord &vector) const
Definition: Rotation.cc:50
cFigure::Point translation
Definition: CanvasProjection.h:30
cFigure::Point scale
Definition: CanvasProjection.h:29
const Rotation& inet::CanvasProjection::getRotation ( ) const
inline

Referenced by inet::visualizer::PhysicalEnvironmentCanvasVisualizer::refreshDisplay().

39 { return rotation; }
Rotation rotation
Definition: CanvasProjection.h:28
const cFigure::Point& inet::CanvasProjection::getScale ( ) const
inline
42 { return scale; }
cFigure::Point scale
Definition: CanvasProjection.h:29
const cFigure::Point& inet::CanvasProjection::getTranslation ( ) const
inline
45 { return translation; }
cFigure::Point translation
Definition: CanvasProjection.h:30
void inet::CanvasProjection::setCanvasProjection ( const cCanvas *  canvas,
const CanvasProjection canvasProjection 
)
static

Referenced by inet::visualizer::SceneCanvasVisualizer::initialize().

48 {
49  canvasProjections[canvas] = canvasProjection;
50 }
static std::map< const cCanvas *, const CanvasProjection * > canvasProjections
Definition: CanvasProjection.h:33
void inet::CanvasProjection::setRotation ( const Rotation rotation)
inline
void inet::CanvasProjection::setScale ( const cFigure::Point &  scale)
inline
void inet::CanvasProjection::setTranslation ( const cFigure::Point &  translation)
inline

Member Data Documentation

std::map< const cCanvas *, const CanvasProjection * > inet::CanvasProjection::canvasProjections
staticprotected
CanvasProjection inet::CanvasProjection::defaultCanvasProjection
staticprotected

Referenced by getCanvasProjection().

Rotation inet::CanvasProjection::rotation
protected

Referenced by computeCanvasPoint().

cFigure::Point inet::CanvasProjection::scale
protected

Referenced by computeCanvasPoint().

cFigure::Point inet::CanvasProjection::translation
protected

Referenced by computeCanvasPoint().


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