Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
Support_USDTrackPainter.h
1// Copyright (c) 2013 - 2019 Marc-Michael Horstmann;
2// Copyright (c) 2020 - 2024 Trend Verlag;
3//
4// trax track library
5// AD 2024
6//
7// "the resolution of all the fruitless searches"
8//
9// Peter Gabriel
10
11
12#pragma once
13
14#include "trax/TrackPainter.h"
15
16#include "SupportUSD_Spat.h"
17
18#if defined(_MSC_VER)
19# pragma warning( push )
20# pragma warning( disable: 4275 ) // non dll-interface class used as base for dll-interface class
21#endif
22#include <pxr/base/vt/array.h>
23#if defined(_MSC_VER)
24# pragma warning( pop )
25#endif
26
27namespace trax{
28
29class BufferedUSDTrackPainter : public trax::SectionPainter{
30public:
31 BufferedUSDTrackPainter( pxr::VtArray<pxr::GfVec3f>& points,
32 pxr::VtArray<int>& indices,
33 pxr::VtArray<int>& faceVertexCounts,
34 Real usdStageMetersPerUnit,
35 int mode = TrackPainter::Mode::mode_default,
36 common::Interval<Length> segmentLimits = {trax::epsilon__length,trax::plausible_maximum_length},
37 Length e = trax::epsilon__length );
38
39protected:
40 void StartPaint( const spat::Frame<Length,One>& rFrame, Length offset, const trax::Section& section ) override;
41 void AddVertex( const spat::Frame<Length,One>& rFrame, const trax::Section::SectionPoint& pt, const spat::Position2D<One>& /*textcoord*/ ) override;
42 void AddTriangle( unsigned int i0, unsigned int i1, unsigned int i2 ) override;
43
44 pxr::VtArray<pxr::GfVec3f>& m_Points;
45private:
46 pxr::VtArray<int>& m_Indices;
47 int m_IndexOffset;
48 pxr::VtArray<int>& m_FaceVertexCounts;
49 Real m_UsdStageMetersPerUnit;
50};
51
52}
void StartPaint(const spat::Frame< Length, One > &rFrame, Length offset, const trax::Section &section) override
Gets called once on rendering startup before all PaintSegment() calls.
Paints a track by taking a cross section as a profile.
Definition TrackPainter.h:132
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
An interval describes the area between two numbers. It is understood to contain the near one and exlu...
Definition Interval.h:42
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
Implements a 2D - position in cartesian coordinates.
Definition Position2D.h:45
Point structure used to describe a section.
Definition Section.h:82
A profile of a track.
Definition Section.h:45