Classes | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
XPlot Class Referenceabstract
Inheritance diagram for XPlot:
Inheritance graph
[legend]

Classes

struct  Payload
 
struct  tCanvasPoint
 

Public Member Functions

 XPlot (const char *name, bool runtime, Transaction &tr_graph, const shared_ptr< XGraph > &graph)
 
virtual XString getLabel () const
 
virtual void clearAllPoints (Transaction &tr)=0
 
int screenToVal (const Snapshot &shot, const XGraph::ScrPoint &scr, XGraph::ValPoint *val, XGraph::SFloat scr_prec=-1)
 
void screenToGraph (const Snapshot &shot, const XGraph::ScrPoint &pt, XGraph::GPoint *g)
 
void graphToScreen (const Snapshot &shot, const XGraph::GPoint &pt, XGraph::ScrPoint *scr)
 
void graphToVal (const Snapshot &shot, const XGraph::GPoint &pt, XGraph::ValPoint *val)
 
const shared_ptr< XStringNode > & label () const
 
const shared_ptr< XUIntNode > & maxCount () const
 
const shared_ptr< XBoolNode > & displayMajorGrid () const
 
const shared_ptr< XBoolNode > & displayMinorGrid () const
 
const shared_ptr< XBoolNode > & drawLines () const
 
const shared_ptr< XBoolNode > & drawBars () const
 
const shared_ptr< XBoolNode > & drawPoints () const
 
const shared_ptr< XBoolNode > & colorPlot () const
 
const shared_ptr< XHexNode > & majorGridColor () const
 
const shared_ptr< XHexNode > & minorGridColor () const
 
const shared_ptr< XHexNode > & pointColor () const
 
const shared_ptr< XHexNode > & lineColor () const
 
const shared_ptr< XHexNode > & barColor () const
 
const shared_ptr< XHexNode > & colorPlotColorHigh () const
 
const shared_ptr< XHexNode > & colorPlotColorLow () const
 
const shared_ptr
< XTouchableNode > & 
clearPoints () const
 
const shared_ptr< XItemNode
< XAxisList, XAxis > > & 
axisX () const
 
const shared_ptr< XItemNode
< XAxisList, XAxis > > & 
axisY () const
 
const shared_ptr< XItemNode
< XAxisList, XAxis > > & 
axisZ () const
 
const shared_ptr< XItemNode
< XAxisList, XAxis > > & 
axisW () const
 
const shared_ptr< XDoubleNode > & zwoAxisZ () const
 z value without AxisZ
 
const shared_ptr< XDoubleNode > & intensity () const
 
virtual int validateAutoScale (const Snapshot &shot)
 auto-scale
 
int drawPlot (const Snapshot &shot, XQGraphPainter *painter)
 Draws points from snapshot.
 
int drawLegend (const Snapshot &shot, XQGraphPainter *painter, const XGraph::ScrPoint &spt, float dx, float dy)
 
void drawGrid (const Snapshot &shot, XQGraphPainter *painter, bool drawzaxis=true)
 
virtual void snapshot (const Snapshot &shot)=0
 Takes a snap-shot all points for rendering.
 
int findPoint (const Snapshot &shot, int start, const XGraph::GPoint &gmin, const XGraph::GPoint &gmax, XGraph::GFloat width, XGraph::ValPoint *val, XGraph::GPoint *g1)
 
bool fixScales (const Snapshot &)
 
- Public Member Functions inherited from XNode
 XNode (const char *name, bool runtime=false)
 
template<class T >
shared_ptr< T > create (const char *name)
 
template<class T , typename... Args>
shared_ptr< T > create (const char *name, bool runtime, Args &&...args)
 
template<class T >
shared_ptr< T > create (Transaction &tr, const char *name)
 
template<class T , typename... Args>
shared_ptr< T > create (Transaction &tr, const char *name, bool runtime, Args &&...args)
 
XString getName () const
 
XString getTypename () const
 
shared_ptr< XNodegetChild (const XString &var) const
 
shared_ptr< XNodegetParent () const
 
void setUIEnabled (bool v)
 Enables/disables controls over scripting/GUI.
 
void disable ()
 Disables all scripting/GUI operations on this node hereafter.
 
- Public Member Functions inherited from Transactional::Node< XNode >
bool insert (Transaction< XNode > &tr, const shared_ptr< XNode > &var, bool online_after_insertion=false)
 
void insert (const shared_ptr< XNode > &var)
 
bool release (Transaction< XNode > &tr, const shared_ptr< XNode > &var)
 
void release (const shared_ptr< XNode > &var)
 
void releaseAll ()
 
bool swap (Transaction< XNode > &tr, const shared_ptr< XNode > &x, const shared_ptr< XNode > &y)
 
void swap (const shared_ptr< XNode > &x, const shared_ptr< XNode > &y)
 
XNodeupperNode (Snapshot< XNode > &shot)
 Finds the parent node in shot.
 
Snapshot< XNodeiterate_commit (Closure)
 
Snapshot< XNodeiterate_commit_if (Closure)
 
void iterate_commit_while (Closure)
 
void print_ () const
 
 Node (const Node &)=delete
 
Nodeoperator= (const Node &)=delete
 

Protected Attributes

const weak_ptr< XGraphm_graph
 
shared_ptr< XAxism_curAxisX
 
shared_ptr< XAxism_curAxisY
 
shared_ptr< XAxism_curAxisZ
 
shared_ptr< XAxism_curAxisW
 
XGraph::ScrPoint m_scr0
 
XGraph::ScrPoint m_len
 
std::vector< XGraph::ValPointm_ptsSnapped
 

Private Member Functions

void onClearPoints (const Snapshot &, XTouchableNode *)
 
bool clipLine (const tCanvasPoint &c1, const tCanvasPoint &c2, XGraph::ScrPoint *s1, XGraph::ScrPoint *s2, bool blendcolor, unsigned int *color1, unsigned int *color2, float *alpha1, float *alpha2)
 
bool isPtIncluded (const XGraph::GPoint &pt)
 
void drawGrid (const Snapshot &shot, XQGraphPainter *painter, shared_ptr< XAxis > &axis1, shared_ptr< XAxis > &axis2)
 
void graphToScreenFast (const XGraph::GPoint &pt, XGraph::ScrPoint *scr)
 
void valToGraphFast (const XGraph::ValPoint &pt, XGraph::GPoint *gr)
 
unsigned int blendColor (unsigned int c1, unsigned int c2, float t)
 

Private Attributes

const shared_ptr< XStringNodem_label
 
const shared_ptr< XUIntNodem_maxCount
 
const shared_ptr< XBoolNodem_displayMajorGrid
 
const shared_ptr< XBoolNodem_displayMinorGrid
 
const shared_ptr< XBoolNodem_drawLines
 
const shared_ptr< XBoolNodem_drawBars
 
const shared_ptr< XBoolNodem_drawPoints
 
const shared_ptr< XBoolNodem_colorPlot
 
const shared_ptr< XHexNodem_majorGridColor
 
const shared_ptr< XHexNodem_minorGridColor
 
const shared_ptr< XHexNodem_pointColor
 
const shared_ptr< XHexNodem_lineColor
 
const shared_ptr< XHexNodem_barColor
 
const shared_ptr< XHexNodem_colorPlotColorHigh
 
const shared_ptr< XHexNodem_colorPlotColorLow
 
const shared_ptr< XTouchableNodem_clearPoints
 
const shared_ptr< XItemNode
< XAxisList, XAxis > > 
m_axisX
 
const shared_ptr< XItemNode
< XAxisList, XAxis > > 
m_axisY
 
const shared_ptr< XItemNode
< XAxisList, XAxis > > 
m_axisZ
 
const shared_ptr< XItemNode
< XAxisList, XAxis > > 
m_axisW
 
const shared_ptr< XDoubleNodem_zwoAxisZ
 z value without AxisZ
 
const shared_ptr< XDoubleNodem_intensity
 
shared_ptr< XListenerm_lsnClearPoints
 
std::vector< tCanvasPointm_canvasPtsSnapped
 

Additional Inherited Members

- Public Types inherited from Transactional::Node< XNode >
using NodeNotFoundError = std::domain_error
 
using NodeList = fast_vector< shared_ptr< XNode >, 2 >
 
using iterator = typename NodeList::iterator
 
using const_iterator = typename NodeList::const_iterator
 
- Static Public Member Functions inherited from XNode
template<class T__ >
static shared_ptr< T__ > createOrphan (const char *name)
 
template<class T__ , typename... Args_>
static shared_ptr< T__ > createOrphan (const char *name, bool runtime, Args_ &&...args)
 
- Protected Member Functions inherited from Transactional::Node< XNode >
 Node ()
 Use create().
 

Detailed Description

Definition at line 158 of file graph.h.

Member Function Documentation

int XPlot::drawLegend ( const Snapshot shot,
XQGraphPainter painter,
const XGraph::ScrPoint spt,
float  dx,
float  dy 
)

Draws a point for legneds. spt the center of the point. dx,dy the size of the area.

Definition at line 394 of file graph.cpp.

References fixScales(), and XQGraphPainter::setColor().

int XPlot::findPoint ( const Snapshot shot,
int  start,
const XGraph::GPoint gmin,
const XGraph::GPoint gmax,
XGraph::GFloat  width,
XGraph::ValPoint val,
XGraph::GPoint g1 
)
Returns
found index, if not return -1

Definition at line 310 of file graph.cpp.

References Vector4< T >::distance2(), and fixScales().

bool XPlot::fixScales ( const Snapshot shot)
Returns
success or not

Definition at line 222 of file graph.cpp.

References zwoAxisZ().

Referenced by drawLegend(), drawPlot(), findPoint(), and screenToVal().

virtual XString XPlot::getLabel ( ) const
inlinevirtual
Returns
i18n name for UI.

Reimplemented from XNode.

Definition at line 161 of file graph.h.

int XPlot::screenToVal ( const Snapshot shot,
const XGraph::ScrPoint scr,
XGraph::ValPoint val,
XGraph::SFloat  scr_prec = -1 
)

obtains values from screen coordinate if scr_prec > 0, value will be rounded around scr_prec

See Also
XAxis::AxisToVal.

Definition at line 273 of file graph.cpp.

References fixScales().


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

Generated for KAME4 by  doxygen 1.8.3