Simbody  3.7
DecorativeGeometry.h
Go to the documentation of this file.
1 #ifndef SimTK_SimTKCOMMON_DECORATIVE_GEOMETRY_H_
2 #define SimTK_SimTKCOMMON_DECORATIVE_GEOMETRY_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * Simbody(tm): SimTKcommon *
6  * -------------------------------------------------------------------------- *
7  * This is part of the SimTK biosimulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11  * *
12  * Portions copyright (c) 2005-15 Stanford University and the Authors. *
13  * Authors: Michael Sherman *
14  * Contributors: Jack Middleton, Peter Eastman, Ayman Habib *
15  * *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17  * not use this file except in compliance with the License. You may obtain a *
18  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19  * *
20  * Unless required by applicable law or agreed to in writing, software *
21  * distributed under the License is distributed on an "AS IS" BASIS, *
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23  * See the License for the specific language governing permissions and *
24  * limitations under the License. *
25  * -------------------------------------------------------------------------- */
26 
30 #include "SimTKcommon/Simmatrix.h"
32 
33 #include <cassert>
34 
35 
36 namespace SimTK {
37 
38 // Some common RGB values;
39 extern SimTK_SimTKCOMMON_EXPORT const Vec3 Black;
40 extern SimTK_SimTKCOMMON_EXPORT const Vec3 Gray;
41 extern SimTK_SimTKCOMMON_EXPORT const Vec3 Red;
42 extern SimTK_SimTKCOMMON_EXPORT const Vec3 Green;
43 extern SimTK_SimTKCOMMON_EXPORT const Vec3 Blue;
48 extern SimTK_SimTKCOMMON_EXPORT const Vec3 Cyan;
49 extern SimTK_SimTKCOMMON_EXPORT const Vec3 White;
50 
51 // Drawing representations
52 
53 class DecorativeGeometryImplementation;
54 
87 public:
89 DecorativeGeometry() : rep(0) { }
96 DecorativeGeometry& operator=(const DecorativeGeometry& source);
97 
100  Hide = 0,
101  DrawPoints = 1,
102  DrawWireframe = 2,
103  DrawSurface = 3,
104 
105  DrawDefault = -1
106 };
107 
118 DecorativeGeometry& setBodyId(int bodyId);
119 
127 DecorativeGeometry& setIndexOnBody(int index);
128 
142 DecorativeGeometry& setUserRef(void* userRef);
143 
149 DecorativeGeometry& setTransform(const Transform& X_BG);
150 
159 DecorativeGeometry& setResolution(Real);
160 
168 DecorativeGeometry& setScaleFactors(const Vec3& scale);
169 
171 DecorativeGeometry& setScale(Real scale) {return setScaleFactors(Vec3(scale));}
172 
178 int getBodyId() const;
179 
184 int getIndexOnBody() const;
185 
190 void* getUserRef() const;
191 
194 Real getResolution() const;
195 
199 const Transform& getTransform() const;
200 
204 const Vec3& getScaleFactors() const;
205 
211 DecorativeGeometry& setColor(const Vec3& rgb); // 0-1 for each color
212 
216 DecorativeGeometry& setOpacity(Real); // 0-1; default is 1 (opaque)
217 
222 DecorativeGeometry& setLineThickness(Real);
223 
226 const Vec3& getColor() const;
228 Real getOpacity() const;
231 Real getLineThickness() const;
232 
237 DecorativeGeometry& setFaceCamera(int shouldFace);
240 int getFaceCamera() const;
241 
245 DecorativeGeometry& setRepresentation(const Representation&);
246 
248 Representation getRepresentation() const;
249 
250 void implementGeometry(DecorativeGeometryImplementation&) const;
251 
252 // Bookkeeping below here -- internal use only. Don't look below or you will
253 // turn into a pillar of salt.
254 bool isOwnerHandle() const;
255 bool isEmptyHandle() const;
256 explicit DecorativeGeometry(class DecorativeGeometryRep* r) : rep(r) { }
257 bool hasRep() const {return rep!=0;}
258 const DecorativeGeometryRep& getRep() const {assert(rep); return *rep;}
259 DecorativeGeometryRep& updRep() {assert(rep); return *rep;}
260 protected:
261 DecorativeGeometryRep* rep;
262 };
263 
264 
270 public:
271  explicit DecorativePoint(const Vec3& p=Vec3(0));
272 
273  // These are specific to DecorativePoint.
274 
275  DecorativePoint& setPoint(const Vec3& p);
276  const Vec3& getPoint() const;
277 
278  // Retain the derived type when setting generic geometry options.
285  DecorativePoint& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
289  { DecorativeGeometry::setRepresentation(r); return *this; }
290 
292 private:
293  class DecorativePointRep& updRep();
294  const DecorativePointRep& getRep() const;
295 };
296 
307 public:
308  explicit DecorativeLine(const Vec3& p1=Vec3(0), const Vec3& p2=Vec3(1)); // line between p1 and p2
309 
310  // These are specific to lines.
311  DecorativeLine& setPoint1(const Vec3& p1);
312  DecorativeLine& setPoint2(const Vec3& p2);
313  DecorativeLine& setEndpoints(const Vec3& p1, const Vec3& p2);
314 
315  // Retain the derived type when setting generic geometry options.
322  DecorativeLine& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
326  { DecorativeGeometry::setRepresentation(r); return *this; }
327 
328  const Vec3& getPoint1() const;
329  const Vec3& getPoint2() const;
330 
332 private:
333  class DecorativeLineRep& updRep();
334  const DecorativeLineRep& getRep() const;
335 };
336 
340 public:
341  explicit DecorativeCircle(Real radius=0.5);
342 
343  DecorativeCircle& setRadius(Real);
344  Real getRadius() const;
345 
346  // Retain the derived type when setting generic geometry options.
353  DecorativeCircle& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
357  { DecorativeGeometry::setRepresentation(r); return *this; }
358 
360 private:
361  class DecorativeCircleRep& updRep();
362  const DecorativeCircleRep& getRep() const;
363 };
364 
368 public:
369  explicit DecorativeSphere(Real radius=0.5);
370 
371  DecorativeSphere& setRadius(Real);
372  Real getRadius() const;
373 
374  // Retain the derived type when setting generic geometry options.
381  DecorativeSphere& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
385  { DecorativeGeometry::setRepresentation(r); return *this; }
386 
388 private:
389  class DecorativeSphereRep& updRep();
390  const DecorativeSphereRep& getRep() const;
391 };
392 
397 public:
398  explicit DecorativeEllipsoid(const Vec3& radii =
399  Vec3(Real(0.5),Real(1/3.),Real(0.25)));
400 
401  DecorativeEllipsoid& setRadii(const Vec3&);
402  const Vec3& getRadii() const;
403 
404  // Retain the derived type when setting generic geometry options.
415  { DecorativeGeometry::setRepresentation(r); return *this; }
416 
418 private:
419  class DecorativeEllipsoidRep& updRep();
420  const DecorativeEllipsoidRep& getRep() const;
421 };
422 
427 public:
428  explicit DecorativeBrick(const Vec3& halfLengths = Vec3(Real(0.5)));
429 
430  DecorativeBrick& setHalfLengths(const Vec3&);
431  const Vec3& getHalfLengths() const;
432 
433  // Retain the derived type when setting generic geometry options.
440  DecorativeBrick& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
444  { DecorativeGeometry::setRepresentation(r); return *this; }
445 
447 private:
448  class DecorativeBrickRep& updRep();
449  const DecorativeBrickRep& getRep() const;
450 };
451 
456 public:
457  explicit DecorativeCylinder(Real radius=0.5, Real halfHeight=0.5);
458 
459  DecorativeCylinder& setRadius(Real);
460  DecorativeCylinder& setHalfHeight(Real);
461  Real getRadius() const;
462  Real getHalfHeight() const;
463 
464  // Retain the derived type when setting generic geometry options.
475  { DecorativeGeometry::setRepresentation(r); return *this; }
476 
478 private:
479  class DecorativeCylinderRep& updRep();
480  const DecorativeCylinderRep& getRep() const;
481 };
482 
487 public:
488  explicit DecorativeFrame(Real axisLength=1);
489 
490  DecorativeFrame& setAxisLength(Real);
491  Real getAxisLength() const;
492 
493  // Retain the derived type when setting generic geometry options.
500  DecorativeFrame& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
504  { DecorativeGeometry::setRepresentation(r); return *this; }
505 
507 private:
508  class DecorativeFrameRep& updRep();
509  const DecorativeFrameRep& getRep() const;
510 };
511 
515 public:
516  explicit DecorativeText(const std::string& label="");
517 
518  DecorativeText& setText(const std::string& label);
519  const std::string& getText() const;
520 
523  DecorativeText& setIsScreenText(bool isScreen);
524  bool getIsScreenText() const;
525 
526  // Retain the derived type when setting generic geometry options.
533  DecorativeText& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
538  { DecorativeGeometry::setRepresentation(r); return *this; }
539 
541 private:
542  class DecorativeTextRep& updRep();
543  const DecorativeTextRep& getRep() const;
544 };
545 
550 public:
551  explicit DecorativeMesh(const PolygonalMesh& mesh);
552  const PolygonalMesh& getMesh() const;
553 
554  // Retain the derived type when setting generic geometry options.
561  DecorativeMesh& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
565  { DecorativeGeometry::setRepresentation(r); return *this; }
566 
568 private:
569  class DecorativeMeshRep& updRep();
570  const DecorativeMeshRep& getRep() const;
571 };
572 
573 
580 public:
581  explicit DecorativeMeshFile(const std::string& meshFileName);
582  const std::string& getMeshFile() const;
585  const PolygonalMesh& getMesh() const;
586 
587  // Retain the derived type when setting generic geometry options.
598  { DecorativeGeometry::setRepresentation(r); return *this; }
599 
601 private:
602  class DecorativeMeshFileRep& updRep();
603  const DecorativeMeshFileRep& getRep() const;
604 };
605 
606 
613 public:
614  explicit DecorativeTorus(Real torusR=1, Real tubeR=0.1);
615 
616  DecorativeTorus& setTorusRadius(Real);
617  DecorativeTorus& setTubeRadius(Real);
618  Real getTorusRadius() const;
619  Real getTubeRadius() const;
620 
621  // Retain the derived type when setting generic geometry options.
628  DecorativeTorus& setColor(const Vec3& rgb) { DecorativeGeometry::setColor(rgb); return *this; }
632  {
633  DecorativeGeometry::setRepresentation(r); return *this;
634  }
635 
637 private:
638  class DecorativeTorusRep& updRep();
639  const DecorativeTorusRep& getRep() const;
640 };
641 
642 
655 public:
656  explicit DecorativeArrow(const Vec3& startPoint = Vec3(0), const Vec3& endPoint = Vec3(1), Real tipLength = 0.35); // Arrow
657  const Vec3& getStartPoint() const;
658  const Vec3& getEndPoint() const;
659  const Real& getTipLength() const;
660 
661  DecorativeArrow& setStartPoint(const Vec3& start);
662  DecorativeArrow& setEndPoint(const Vec3& end);
663  DecorativeArrow& setTipLength(Real);
664 
665  // Retain the derived type when setting generic geometry options.
672  DecorativeArrow& setColor(const Vec3& rgb) { DecorativeGeometry::setColor(rgb); return *this; }
676  {
677  DecorativeGeometry::setRepresentation(r); return *this;
678  }
679 
681 private:
682  class DecorativeArrowRep& updRep();
683  const DecorativeArrowRep& getRep() const;
684 };
685 
686 
697 public:
698  explicit DecorativeCone(const Vec3& p1 = Vec3(0), const UnitVec3& dir = UnitVec3(1,1,1),
699  Real height = 1.0, Real baseRadius = 0.5); // Cone
700  const Vec3& getOrigin() const;
701  const UnitVec3& getDirection() const;
702  const Real& getHeight() const;
703  const Real& getBaseRadius() const;
704 
705  DecorativeCone& setOrigin(const Vec3& origin);
706  DecorativeCone& setDirection(const UnitVec3& direction);
707  DecorativeCone& setHeight(Real length);
708  DecorativeCone& setBaseRadius(Real base);
709 
710  // Retain the derived type when setting generic geometry options.
717  DecorativeCone& setColor(const Vec3& rgb) { DecorativeGeometry::setColor(rgb); return *this; }
721  {
722  DecorativeGeometry::setRepresentation(r); return *this;
723  }
724 
726 private:
727  class DecorativeConeRep& updRep();
728  const DecorativeConeRep& getRep() const;
729 };
730 
741 public:
743  Decorations();
746  explicit Decorations(const DecorativeGeometry& decoration);
748  Decorations& addDecoration(const DecorativeGeometry& decoration);
751  Decorations& addDecoration(const Transform& placement,
752  const DecorativeGeometry& decoration);
755  int getNumDecorations() const;
758  const DecorativeGeometry& getDecoration(int i) const;
759 
760  // Retain the derived type when setting generic geometry options.
767  Decorations& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
771  { DecorativeGeometry::setRepresentation(r); return *this; }
772 
773 
775 private:
776  class DecorationsRep& updRep();
777  const DecorationsRep& getRep() const;
778 };
779 
783 public:
785  virtual void implementPointGeometry( const DecorativePoint&) = 0;
786  virtual void implementLineGeometry( const DecorativeLine&) = 0;
787  virtual void implementBrickGeometry( const DecorativeBrick&) = 0;
788  virtual void implementCylinderGeometry( const DecorativeCylinder&) = 0;
789  virtual void implementCircleGeometry( const DecorativeCircle&) = 0;
790  virtual void implementSphereGeometry( const DecorativeSphere&) = 0;
791  virtual void implementEllipsoidGeometry(const DecorativeEllipsoid&)= 0;
792  virtual void implementFrameGeometry( const DecorativeFrame&) = 0;
793  virtual void implementTextGeometry( const DecorativeText&) = 0;
794  virtual void implementMeshGeometry( const DecorativeMesh&) = 0;
795  virtual void implementMeshFileGeometry( const DecorativeMeshFile&) = 0;
796  virtual void implementTorusGeometry( const DecorativeTorus&) = 0;
797  virtual void implementArrowGeometry( const DecorativeArrow&) = 0;
798  virtual void implementConeGeometry( const DecorativeCone&) = 0;
799 };
800 
801 } // namespace SimTK
802 
803 #endif // SimTK_SimTKCOMMON_DECORATIVE_GEOMETRY_H_
DecorativeMesh & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:561
DecorativeCone & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:712
DecorativeArrow & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:669
DecorativeEllipsoid & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:406
DecorativeTorus & setUserRef(void *p)
Definition: DecorativeGeometry.h:624
#define SimTK_PIMPL_DOWNCAST(Derived, Parent)
Similar to the above but for private implementation abstract classes, that is, abstract class hierarc...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:593
DecorativeMeshFile & setResolution(Real r)
Definition: DecorativeGeometry.h:592
DecorativeCircle & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:352
const Vec3 Orange
RGB=( 1,.5, 0)
DecorativeEllipsoid & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:410
DecorativeArrow & setResolution(Real r)
Definition: DecorativeGeometry.h:670
DecorativeMeshFile & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:594
DecorativeCone & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:720
DecorativeCylinder & setLineThickness(Real t)
Definition: DecorativeGeometry.h:473
DecorativeTorus & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:625
const Vec3 Yellow
RGB=( 1, 1, 0)
DecorativeCircle & setUserRef(void *p)
Definition: DecorativeGeometry.h:349
DecorativeMesh & setOpacity(Real o)
Definition: DecorativeGeometry.h:562
#define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:224
DecorativeTorus & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:627
DecorativeFrame & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:500
DecorativePoint & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:282
This defines a rectangular solid centered at the origin and aligned with the local frame axes...
Definition: DecorativeGeometry.h:426
UnitVec< Real, 1 > UnitVec3
Definition: UnitVec.h:41
DecorativeBrick & setLineThickness(Real t)
Definition: DecorativeGeometry.h:442
DecorativeTorus & setResolution(Real r)
Definition: DecorativeGeometry.h:626
DecorativeLine & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:321
DecorativeBrick & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:443
An arrow with start point, end point and tip-length.
Definition: DecorativeGeometry.h:654
DecorativeCone & setUserRef(void *p)
Definition: DecorativeGeometry.h:713
DecorativeText & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:537
DecorativeGeometry & setResolution(Real)
Each concrete DecorativeGeometry object is expected to have a default resolution that gets the point ...
This defines a text label with its base at the origin.
Definition: DecorativeGeometry.h:514
DecorativeCone & setOpacity(Real o)
Definition: DecorativeGeometry.h:718
DecorativeCone & setResolution(Real r)
Definition: DecorativeGeometry.h:715
This defines geometry to represent a coordinate frame.
Definition: DecorativeGeometry.h:486
DecorativeSphere & setLineThickness(Real t)
Definition: DecorativeGeometry.h:383
DecorativeText & setBodyId(int b)
Definition: DecorativeGeometry.h:527
DecorativeArrow & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:672
DecorativeEllipsoid & setOpacity(Real o)
Definition: DecorativeGeometry.h:412
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
DecorativeMesh & setResolution(Real r)
Definition: DecorativeGeometry.h:559
const Vec3 Gray
RGB=(.5,.5,.5)
Decorations & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:764
DecorativeCircle & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:353
DecorativeFrame & setOpacity(Real o)
Definition: DecorativeGeometry.h:501
DecorativeSphere & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:378
DecorativeEllipsoid & setBodyId(int b)
Definition: DecorativeGeometry.h:405
DecorativePoint & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:280
Decorations & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:766
DecorativeCylinder & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:474
DecorativeCylinder & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:470
DecorativeArrow & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:667
DecorativeTorus & setOpacity(Real o)
Definition: DecorativeGeometry.h:629
DecorativeMeshFile & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:589
DecorativeBrick & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:440
Decorations & setBodyId(int b)
Definition: DecorativeGeometry.h:761
DecorativeMeshFile & setOpacity(Real o)
Definition: DecorativeGeometry.h:595
DecorativeGeometry & setIndexOnBody(int index)
For selection or other purposes, you may want to use this method to store an index that can identify ...
DecorativeTorus & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:623
DecorativeMesh & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:556
DecorativeText & setUserRef(void *p)
Definition: DecorativeGeometry.h:529
DecorativeCircle & setOpacity(Real o)
Definition: DecorativeGeometry.h:354
DecorativeEllipsoid & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:408
DecorativeArrow & setBodyId(int b)
Definition: DecorativeGeometry.h:666
This defines an ellipsoidal solid centered at the origin and aligned with the local frame axes...
Definition: DecorativeGeometry.h:396
DecorativeGeometryRep & updRep()
Definition: DecorativeGeometry.h:259
DecorativeEllipsoid & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:411
DecorativeArrow & setLineThickness(Real t)
Definition: DecorativeGeometry.h:674
const DecorativeGeometryRep & getRep() const
Definition: DecorativeGeometry.h:258
DecorativeMesh & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:564
DecorativeMesh & setUserRef(void *p)
Definition: DecorativeGeometry.h:557
DecorativeCircle & setBodyId(int b)
Definition: DecorativeGeometry.h:347
DecorativeFrame & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:503
DecorativeCylinder & setBodyId(int b)
Definition: DecorativeGeometry.h:465
DecorativeSphere & setUserRef(void *p)
Definition: DecorativeGeometry.h:377
const Vec3 Red
RGB=( 1, 0, 0)
DecorativeBrick & setResolution(Real r)
Definition: DecorativeGeometry.h:438
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:606
DecorativeCircle & setLineThickness(Real t)
Definition: DecorativeGeometry.h:355
Representation
Drawing modes.
Definition: DecorativeGeometry.h:99
DecorativeGeometry & setColor(const Vec3 &rgb)
Request a specific color for this DecorativeGeometry object.
DecorativeCone & setLineThickness(Real t)
Definition: DecorativeGeometry.h:719
This defines a displayable torus, the torus is centered at the origin with the axial direction aligne...
Definition: DecorativeGeometry.h:612
DecorativePoint & setLineThickness(Real t)
Definition: DecorativeGeometry.h:287
DecorativeCylinder & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:468
DecorativePoint & setUserRef(void *p)
Definition: DecorativeGeometry.h:281
Decorations & setOpacity(Real o)
Definition: DecorativeGeometry.h:768
DecorativeCircle & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:348
DecorativeGeometry & setScale(Real scale)
Convenience method to set all three scale factors to the same value.
Definition: DecorativeGeometry.h:171
Decorations & setResolution(Real r)
Definition: DecorativeGeometry.h:765
const Vec3 Cyan
RGB=( 0, 1, 1)
DecorativeMeshFile & setLineThickness(Real t)
Definition: DecorativeGeometry.h:596
DecorativeSphere & setOpacity(Real o)
Definition: DecorativeGeometry.h:382
DecorativeGeometryRep * rep
Definition: DecorativeGeometry.h:261
DecorativeBrick & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:437
Decorations & setLineThickness(Real t)
Definition: DecorativeGeometry.h:769
DecorativeSphere & setBodyId(int b)
Definition: DecorativeGeometry.h:375
DecorativeGeometry & setRepresentation(const Representation &)
Request a particular rendering representation of this DecorativeGeometry object.
DecorativeCylinder & setOpacity(Real o)
Definition: DecorativeGeometry.h:472
DecorativePoint & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:288
DecorativeCircle & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:356
DecorativeTorus & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:628
DecorativeSphere & setResolution(Real r)
Definition: DecorativeGeometry.h:379
DecorativeGeometry & setBodyId(int bodyId)
By default the geometry should be placed relative to the Ground frame.
DecorativeFrame & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:495
Decorations & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:770
DecorativeLine & setBodyId(int b)
Definition: DecorativeGeometry.h:316
DecorativeMeshFile & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:593
A cone with origin point, direction, height and base radius.
Definition: DecorativeGeometry.h:696
DecorativeArrow & setOpacity(Real o)
Definition: DecorativeGeometry.h:673
DecorativeGeometry & setScaleFactors(const Vec3 &scale)
Each concrete DecorativeGeometry object is expected to have a default size around "1"...
DecorativeEllipsoid & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:414
DecorativeTorus & setLineThickness(Real t)
Definition: DecorativeGeometry.h:630
DecorativeCone & setBodyId(int b)
Definition: DecorativeGeometry.h:711
DecorativeLine & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:317
DecorativeSphere & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:380
DecorativeTorus & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:631
DecorativeBrick & setUserRef(void *p)
Definition: DecorativeGeometry.h:436
This defines a circle in the x-y plane, centered at the origin.
Definition: DecorativeGeometry.h:339
DecorativeCircle & setResolution(Real r)
Definition: DecorativeGeometry.h:351
DecorativeMesh & setLineThickness(Real t)
Definition: DecorativeGeometry.h:563
DecorativeMeshFile & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:591
DecorativeLine & setUserRef(void *p)
Definition: DecorativeGeometry.h:318
DecorativeBrick & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:439
DecorativeTorus & setBodyId(int b)
Definition: DecorativeGeometry.h:622
DecorativeGeometry & setLineThickness(Real)
Request an adjustment to the default rendering of lines and curves.
DecorativeCircle & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:350
DecorativeGeometry & setOpacity(Real)
Request a level of transparency for this DecorativeGeometry.
const Vec3 Blue
RGB=( 0, 0, 1)
DecorativeText & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:533
DecorativeGeometry()
Default constructor creates an empty handle.
Definition: DecorativeGeometry.h:89
DecorativeFrame & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:499
DecorativeCylinder & setResolution(Real r)
Definition: DecorativeGeometry.h:469
DecorativePoint & setBodyId(int b)
Definition: DecorativeGeometry.h:279
DecorativeEllipsoid & setLineThickness(Real t)
Definition: DecorativeGeometry.h:413
DecorativeBrick & setOpacity(Real o)
Definition: DecorativeGeometry.h:441
DecorativeLine & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:325
This class provides a description of a mesh made of polygonal faces (not limited to triangles)...
Definition: PolygonalMesh.h:70
DecorativeArrow & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:675
Decorations & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:762
const Vec3 Magenta
RGB=( 1, 0, 1)
This is the client-side interface to an implementation-independent representation of "Decorations" su...
Definition: DecorativeGeometry.h:86
This defines a sphere centered at the origin.
Definition: DecorativeGeometry.h:367
A point of interest.
Definition: DecorativeGeometry.h:269
DecorativeText & setOpacity(Real o)
Definition: DecorativeGeometry.h:534
DecorativeLine & setResolution(Real r)
Definition: DecorativeGeometry.h:320
DecorativeMeshFile & setUserRef(void *p)
Definition: DecorativeGeometry.h:590
Decorations & setUserRef(void *p)
Definition: DecorativeGeometry.h:763
DecorativeGeometry(class DecorativeGeometryRep *r)
Definition: DecorativeGeometry.h:256
DecorativeLine & setLineThickness(Real t)
Definition: DecorativeGeometry.h:324
virtual ~DecorativeGeometryImplementation()
Definition: DecorativeGeometry.h:784
DecorativeLine & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:319
DecorativeGeometry & setTransform(const Transform &X_BG)
This transform shifts the generated polygons with respect to this object&#39;s local frame.
DecorativeCylinder & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:471
DecorativeFrame & setUserRef(void *p)
Definition: DecorativeGeometry.h:496
DecorativeText & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:528
DecorativeCone & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:716
bool hasRep() const
Definition: DecorativeGeometry.h:257
DecorativeFrame & setLineThickness(Real t)
Definition: DecorativeGeometry.h:502
DecorativeEllipsoid & setUserRef(void *p)
Definition: DecorativeGeometry.h:407
const Vec3 White
RGB=( 1, 1, 1)
DecorativeText & setResolution(Real r)
Definition: DecorativeGeometry.h:531
DecorativeMeshFile & setBodyId(int b)
Definition: DecorativeGeometry.h:588
DecorativeCylinder & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:466
DecorativeBrick & setBodyId(int b)
Definition: DecorativeGeometry.h:434
DecorativeCone & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:714
DecorativePoint & setResolution(Real r)
Definition: DecorativeGeometry.h:283
DecorativeText & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:532
DecorativeMesh & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:558
DecorativeLine & setOpacity(Real o)
Definition: DecorativeGeometry.h:323
const Vec3 Purple
RGB=(.5, 0,.5)
DecorativeMeshFile & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:597
DecorativePoint & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:285
DecorativeGeometry & setFaceCamera(int shouldFace)
Set whether the geometry acts as a billboard, always rotating to face the camera. ...
This defines a displayable mesh by referencing a file name containing the mesh.
Definition: DecorativeGeometry.h:579
DecorativeSphere & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:381
This defines a single DecorativeGeometry object that is composed of a collection of other DecorativeG...
Definition: DecorativeGeometry.h:740
DecorativeText & setFaceCamera(int yn)
Definition: DecorativeGeometry.h:536
Vec< 3 > Vec3
This is the most common 3D vector type: a column of 3 Real values stored consecutively in memory (pac...
Definition: SmallMatrix.h:129
const Vec3 Green
RGB=( 0, 1, 0)
DecorativeFrame & setBodyId(int b)
Definition: DecorativeGeometry.h:494
A line between two points.
Definition: DecorativeGeometry.h:306
DecorativeMesh & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:560
DecorativeGeometry & setUserRef(void *userRef)
Use this method to store an arbitrary reference pointer with this DecorativeGeometry object...
This is the header which should be included in user programs that would like to make use of all the S...
DecorativeBrick & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:435
Use this abstract class to connect your implementation of decorative geometry to the implementation-i...
Definition: DecorativeGeometry.h:782
DecorativePoint & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:284
Decorations & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:767
DecorativeArrow & setScaleFactors(const Vec3 &s)
Definition: DecorativeGeometry.h:671
DecorativePoint & setOpacity(Real o)
Definition: DecorativeGeometry.h:286
DecorativeCone & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:717
DecorativeCylinder & setUserRef(void *p)
Definition: DecorativeGeometry.h:467
DecorativeFrame & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:497
DecorativeText & setTransform(const Transform &X_BD)
Definition: DecorativeGeometry.h:530
This defines a cylinder centered on the origin and aligned in the y direction.
Definition: DecorativeGeometry.h:455
DecorativeMesh & setBodyId(int b)
Definition: DecorativeGeometry.h:555
DecorativeEllipsoid & setResolution(Real r)
Definition: DecorativeGeometry.h:409
DecorativeText & setLineThickness(Real t)
Definition: DecorativeGeometry.h:535
DecorativeSphere & setRepresentation(const Representation &r)
Definition: DecorativeGeometry.h:384
DecorativeSphere & setIndexOnBody(int x)
Definition: DecorativeGeometry.h:376
DecorativeFrame & setResolution(Real r)
Definition: DecorativeGeometry.h:498
This defines a displayable mesh by referencing an already-existing PolygonalMesh object.
Definition: DecorativeGeometry.h:549
DecorativeArrow & setUserRef(void *p)
Definition: DecorativeGeometry.h:668
DecorativeLine & setColor(const Vec3 &rgb)
Definition: DecorativeGeometry.h:322
const Vec3 Black
RGB=( 0, 0, 0)