1313#include < mrpt/math/CMatrixDynamic.h>
1414#include < mrpt/math/geometry.h>
1515#include < mrpt/obs/CObservation2DRangeScan.h>
16- #include < mrpt/viz/CRenderizableShaderTriangles.h>
17- #include < mrpt/viz/CRenderizableShaderWireFrame.h>
1816#include < mrpt/viz/CSetOfLines.h>
1917#include < mrpt/viz/CSetOfTriangles.h>
18+ #include < mrpt/viz/CVisualObject.h>
2019
2120namespace mrpt ::viz
2221{
@@ -39,8 +38,9 @@ namespace mrpt::viz
3938 * \ingroup mrpt_maps_grp
4039 */
4140class CAngularObservationMesh :
42- public CRenderizableShaderTriangles,
43- public CRenderizableShaderWireFrame
41+ virtual public CVisualObject,
42+ public VisualObjectParams_Triangles,
43+ public VisualObjectParams_Lines
4444{
4545 DEFINE_SERIALIZABLE (CAngularObservationMesh, mrpt::viz)
4646 public:
@@ -120,7 +120,7 @@ class CAngularObservationMesh :
120120 * and the increment.
121121 * \throw std::logic_error if the increment is zero.
122122 */
123- inline static TDoubleRange CreateFromIncrement (double initial, double final , double increment)
123+ static TDoubleRange CreateFromIncrement (double initial, double final , double increment)
124124 {
125125 if (increment == 0 ) throw std::logic_error (" Invalid increment value." );
126126 return TDoubleRange (initial, final , increment);
@@ -129,24 +129,23 @@ class CAngularObservationMesh :
129129 * Creates a range of values from the initial value, the final value
130130 * and a desired amount of samples.
131131 */
132- inline static TDoubleRange CreateFromAmount (double initial, double final , size_t amount)
132+ static TDoubleRange CreateFromAmount (double initial, double final , size_t amount)
133133 {
134134 return TDoubleRange (initial, final , amount);
135135 }
136136 /* *
137137 * Creates a zero-centered range of values from an aperture, an amount
138138 * of samples and a direction.
139139 */
140- inline static TDoubleRange CreateFromAperture (
141- double aperture, size_t amount, bool negToPos = true )
140+ static TDoubleRange CreateFromAperture (double aperture, size_t amount, bool negToPos = true )
142141 {
143142 return TDoubleRange (aperture, amount, negToPos);
144143 }
145144 /* *
146145 * Returns the total aperture of the range.
147146 * \throw std::logic_error on invalid range type.
148147 */
149- inline double aperture () const
148+ double aperture () const
150149 {
151150 switch (rangeType)
152151 {
@@ -167,7 +166,7 @@ class CAngularObservationMesh :
167166 * Returns the first value of the range.
168167 * \throw std::logic_error on invalid range type.
169168 */
170- inline double initialValue () const
169+ double initialValue () const
171170 {
172171 switch (rangeType)
173172 {
@@ -185,7 +184,7 @@ class CAngularObservationMesh :
185184 * Returns the last value of the range.
186185 * \throw std::logic_error on invalid range type.
187186 */
188- inline double finalValue () const
187+ double finalValue () const
189188 {
190189 switch (rangeType)
191190 {
@@ -207,7 +206,7 @@ class CAngularObservationMesh :
207206 * Returns the increment between two consecutive values of the range.
208207 * \throw std::logic_error on invalid range type.
209208 */
210- inline double increment () const
209+ double increment () const
211210 {
212211 switch (rangeType)
213212 {
@@ -228,7 +227,7 @@ class CAngularObservationMesh :
228227 * Returns the total amount of values in this range.
229228 * \throw std::logic_error on invalid range type.
230229 */
231- inline size_t amount () const
230+ size_t amount () const
232231 {
233232 switch (rangeType)
234233 {
@@ -257,7 +256,7 @@ class CAngularObservationMesh :
257256 * positive, false otherwise.
258257 * \throw std::logic_error on invalid range type.
259258 */
260- inline bool negToPos () const
259+ bool negToPos () const
261260 {
262261 switch (rangeType)
263262 {
@@ -315,47 +314,28 @@ class CAngularObservationMesh :
315314 /* *
316315 * Returns whether the object is configured as wireframe or solid.
317316 */
318- inline bool isWireframe () const { return m_Wireframe; }
317+ bool isWireframe () const { return m_Wireframe; }
319318 /* *
320319 * Sets the display mode for the object. True=wireframe, False=solid.
321320 */
322- inline void setWireframe (bool enabled = true )
321+ void setWireframe (bool enabled = true )
323322 {
324323 m_Wireframe = enabled;
325- CRenderizable ::notifyChange ();
324+ CVisualObject ::notifyChange ();
326325 }
327326 /* *
328327 * Returns whether the object may be transparent or not.
329328 */
330- inline bool isTransparencyEnabled () const { return mEnableTransparency ; }
329+ bool isTransparencyEnabled () const { return mEnableTransparency ; }
331330 /* *
332331 * Enables or disables transparencies.
333332 */
334- inline void enableTransparency (bool enabled = true )
333+ void enableTransparency (bool enabled = true )
335334 {
336335 mEnableTransparency = enabled;
337- CRenderizable ::notifyChange ();
336+ CVisualObject ::notifyChange ();
338337 }
339338
340- /* * @name Renderizable shader API virtual methods
341- * @{ */
342- void freeOpenGLResources () override
343- {
344- CRenderizableShaderTriangles::freeOpenGLResources ();
345- CRenderizableShaderWireFrame::freeOpenGLResources ();
346- }
347- void render (const RenderContext& rc) const override ;
348- void renderUpdateBuffers () const override ;
349-
350- virtual shader_list_t requiredShaders () const override
351- {
352- // May use up to two shaders (triangles and lines):
353- return {DefaultShaderID::WIREFRAME, DefaultShaderID::TRIANGLES_LIGHT};
354- }
355- void onUpdateBuffers_Wireframe () override ;
356- void onUpdateBuffers_Triangles () override ;
357- /* * @} */
358-
359339 /* *
360340 * Traces a ray to the object, returning the distance to a given pose
361341 * through its X axis.
0 commit comments