![]() |
Trax3 3.1.0
trax track library
|
Base class for painting tracks as a series of short straight pieces. More...
#include <C:/Trend/Development/Trax3/Code/trax/TrackPainter.h>

Public Types | |
| enum | Mode { mode_none = 0x00 , mode_leftHandedFaces = 0x01 , mode_constantSegmentLength = 0x02 , mode_SegmentLength = 0x04 , mode_checkedSegmentLength = 0x04 , mode_totallycheckedSegmentLength = 0x08 , mode_ignoreCuvesTorsion = 0x10 , mode_localFrame = 0x20 , mode_startFrame = 0x40 , mode_default = mode_none } |
Public Member Functions | |||||||
| TrackPainter & | operator= (const TrackPainter &)=default | ||||||
| TrackPainter & | operator= (TrackPainter &&)=default | ||||||
| TrackPainter & | operator() (const SectionTrack &track) | ||||||
| int | GetMode () const noexcept | ||||||
| int | GetCountSegments () const noexcept | ||||||
Construction | |||||||
Creates the track painter. To make for a constant segment length, have segmentLimits.Near() == segmentLimits.Far(), this will save some computations, but will probabably not give the most efficent mesh to render.
| |||||||
| dclspc | TrackPainter (int mode, common::Interval< Length > segmentLimits={epsilon__length, plausible_maximum_length}, Length e=epsilon__length) | ||||||
| dclspc | TrackPainter (const TrackPainter &)=default | ||||||
| dclspc | TrackPainter (TrackPainter &&)=default | ||||||
| dclspc Length | Paint (const TrackBuilder &track, const Section §ion, Length offset=0_m) | ||||||
| Paints the track. | |||||||
Protected Member Functions | |
| virtual void | StartPaint (const spat::Frame< Length, One > &, Length, const Section &) |
| Gets called once on rendering startup before all PaintSegment() calls. | |
| virtual void | PaintSegment (const spat::Frame< Length, One > &rFrame, Length segmentLength, const Section &)=0 |
| This gets called once per segment to paint a segment of the track. | |
| virtual void | EndPaint (const spat::Frame< Length, One > &) |
| Gets called once on rendering end after all PaintSegment() calls. | |
Base class for painting tracks as a series of short straight pieces.
|
inlinenoexcept |
|
inlinenoexcept |
| dclspc Length trax::TrackPainter::Paint | ( | const TrackBuilder & | track, |
| const Section & | section, | ||
| Length | offset = 0_m ) |
Paints the track.
For reaching the track's end, the last segment might be shorter than what would serve the limits given.
| track | The track to paint. |
| section | The section to be used for painting. |
| offset | If connected tracks are painted, it can be usefull to supply the return value of a connected track's painting call here. This can be used to adjust texture coordinates for example. |
|
protectedpure virtual |
This gets called once per segment to paint a segment of the track.
| rFrame | Position and orientation at the end of the segment to paint. |
| segmentLength | Length of the segment. This value migh vary from call to call. |
Implemented in trax::SectionPainter.
|
inlineprotectedvirtual |
Gets called once on rendering startup before all PaintSegment() calls.
Reimplemented in trax::BufferedPainter_Base< PointType_ >, trax::BufferedPainter_Base< PointType >, trax::BufferedPainter_Base< spat::Position< Length > >, trax::BufferedPainter_Base< std::pair< spat::VectorBundle2< Length, One >, spat::Position2D< One > > >, trax::BufferedPainter_Base< std::pair< spat::VectorBundle< Length, One >, spat::Position2D< One > > >, trax::BufferedUSDTrackPainter, and trax::SectionPainter.