Simbody 3.9
Loading...
Searching...
No Matches
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
32
33#include <cassert>
34
35
36namespace SimTK {
37
38// Some common RGB values;
39
40constexpr Vec3 Black = Vec3( 0, 0, 0);
41constexpr Vec3 Gray = Vec3(.5,.5,.5);
42constexpr Vec3 Red = Vec3( 1, 0, 0);
43constexpr Vec3 Green = Vec3( 0, 1, 0);
44constexpr Vec3 Blue = Vec3( 0, 0, 1);
45constexpr Vec3 Yellow = Vec3( 1, 1, 0);
46constexpr Vec3 Orange = Vec3( 1,.5, 0);
47constexpr Vec3 Magenta = Vec3( 1, 0, 1);
48constexpr Vec3 Purple = Vec3(.5, 0,.5);
49constexpr Vec3 Cyan = Vec3( 0, 1, 1);
50constexpr Vec3 White = Vec3( 1, 1, 1);
51
52// Drawing representations
53
55
88public:
90DecorativeGeometry() : rep(0) { }
98
101 Hide = 0,
102 DrawPoints = 1,
103 DrawWireframe = 2,
104 DrawSurface = 3,
105
106 DrawDefault = -1
108
120
129
144
151
161
170
172DecorativeGeometry& setScale(Real scale) {return setScaleFactors(Vec3(scale));}
173
179int getBodyId() const;
180
185int getIndexOnBody() const;
186
191void* getUserRef() const;
192
196
200const Transform& getTransform() const;
201
205const Vec3& getScaleFactors() const;
206
212DecorativeGeometry& setColor(const Vec3& rgb); // 0-1 for each color
213
217DecorativeGeometry& setOpacity(Real); // 0-1; default is 1 (opaque)
218
224
227const Vec3& getColor() const;
233
241int getFaceCamera() const;
242
247
250
252
253// Bookkeeping below here -- internal use only. Don't look below or you will
254// turn into a pillar of salt.
255bool isOwnerHandle() const;
256bool isEmptyHandle() const;
257explicit DecorativeGeometry(class DecorativeGeometryRep* r) : rep(r) { }
258bool hasRep() const {return rep!=0;}
259const DecorativeGeometryRep& getRep() const {assert(rep); return *rep;}
260DecorativeGeometryRep& updRep() {assert(rep); return *rep;}
261protected:
262DecorativeGeometryRep* rep;
263};
264
265
271public:
272 explicit DecorativePoint(const Vec3& p=Vec3(0));
273
274 // These are specific to DecorativePoint.
275
277 const Vec3& getPoint() const;
278
279 // Retain the derived type when setting generic geometry options.
280 DecorativePoint& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
281 DecorativePoint& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
282 DecorativePoint& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
283 DecorativePoint& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
284 DecorativePoint& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
285 DecorativePoint& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
286 DecorativePoint& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
287 DecorativePoint& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
288 DecorativePoint& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
290 { DecorativeGeometry::setRepresentation(r); return *this; }
291
293private:
294 class DecorativePointRep& updRep();
295 const DecorativePointRep& getRep() const;
296};
297
308public:
309 explicit DecorativeLine(const Vec3& p1=Vec3(0), const Vec3& p2=Vec3(1)); // line between p1 and p2
310
311 // These are specific to lines.
314 DecorativeLine& setEndpoints(const Vec3& p1, const Vec3& p2);
315
316 // Retain the derived type when setting generic geometry options.
317 DecorativeLine& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
318 DecorativeLine& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
319 DecorativeLine& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
320 DecorativeLine& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
321 DecorativeLine& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
322 DecorativeLine& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
323 DecorativeLine& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
324 DecorativeLine& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
325 DecorativeLine& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
327 { DecorativeGeometry::setRepresentation(r); return *this; }
328
329 const Vec3& getPoint1() const;
330 const Vec3& getPoint2() const;
331
333private:
334 class DecorativeLineRep& updRep();
335 const DecorativeLineRep& getRep() const;
336};
337
341public:
342 explicit DecorativeCircle(Real radius=0.5);
343
346
347 // Retain the derived type when setting generic geometry options.
348 DecorativeCircle& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
349 DecorativeCircle& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
350 DecorativeCircle& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
351 DecorativeCircle& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
352 DecorativeCircle& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
353 DecorativeCircle& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
354 DecorativeCircle& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
355 DecorativeCircle& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
356 DecorativeCircle& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
358 { DecorativeGeometry::setRepresentation(r); return *this; }
359
361private:
362 class DecorativeCircleRep& updRep();
363 const DecorativeCircleRep& getRep() const;
364};
365
369public:
370 explicit DecorativeSphere(Real radius=0.5);
371
374
375 // Retain the derived type when setting generic geometry options.
376 DecorativeSphere& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
377 DecorativeSphere& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
378 DecorativeSphere& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
379 DecorativeSphere& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
380 DecorativeSphere& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
381 DecorativeSphere& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
382 DecorativeSphere& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
383 DecorativeSphere& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
384 DecorativeSphere& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
386 { DecorativeGeometry::setRepresentation(r); return *this; }
387
389private:
390 class DecorativeSphereRep& updRep();
391 const DecorativeSphereRep& getRep() const;
392};
393
398public:
399 explicit DecorativeEllipsoid(const Vec3& radii =
400 Vec3(Real(0.5),Real(1/3.),Real(0.25)));
401
403 const Vec3& getRadii() const;
404
405 // Retain the derived type when setting generic geometry options.
406 DecorativeEllipsoid& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
407 DecorativeEllipsoid& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
408 DecorativeEllipsoid& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
409 DecorativeEllipsoid& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
410 DecorativeEllipsoid& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
411 DecorativeEllipsoid& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
412 DecorativeEllipsoid& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
413 DecorativeEllipsoid& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
414 DecorativeEllipsoid& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
416 { DecorativeGeometry::setRepresentation(r); return *this; }
417
419private:
420 class DecorativeEllipsoidRep& updRep();
421 const DecorativeEllipsoidRep& getRep() const;
422};
423
428public:
429 explicit DecorativeBrick(const Vec3& halfLengths = Vec3(Real(0.5)));
430
432 const Vec3& getHalfLengths() const;
433
434 // Retain the derived type when setting generic geometry options.
435 DecorativeBrick& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
436 DecorativeBrick& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
437 DecorativeBrick& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
438 DecorativeBrick& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
439 DecorativeBrick& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
440 DecorativeBrick& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
441 DecorativeBrick& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
442 DecorativeBrick& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
443 DecorativeBrick& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
445 { DecorativeGeometry::setRepresentation(r); return *this; }
446
448private:
449 class DecorativeBrickRep& updRep();
450 const DecorativeBrickRep& getRep() const;
451};
452
457public:
458 explicit DecorativeCylinder(Real radius=0.5, Real halfHeight=0.5);
459
464
465 // Retain the derived type when setting generic geometry options.
466 DecorativeCylinder& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
467 DecorativeCylinder& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
468 DecorativeCylinder& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
469 DecorativeCylinder& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
470 DecorativeCylinder& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
471 DecorativeCylinder& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
472 DecorativeCylinder& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
473 DecorativeCylinder& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
474 DecorativeCylinder& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
476 { DecorativeGeometry::setRepresentation(r); return *this; }
477
479private:
480 class DecorativeCylinderRep& updRep();
481 const DecorativeCylinderRep& getRep() const;
482};
483
488public:
489 explicit DecorativeFrame(Real axisLength=1);
490
493
494 // Retain the derived type when setting generic geometry options.
495 DecorativeFrame& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
496 DecorativeFrame& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
497 DecorativeFrame& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
498 DecorativeFrame& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
499 DecorativeFrame& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
500 DecorativeFrame& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
501 DecorativeFrame& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
502 DecorativeFrame& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
503 DecorativeFrame& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
505 { DecorativeGeometry::setRepresentation(r); return *this; }
506
508private:
509 class DecorativeFrameRep& updRep();
510 const DecorativeFrameRep& getRep() const;
511};
512
516public:
517 explicit DecorativeText(const std::string& label="");
518
519 DecorativeText& setText(const std::string& label);
520 const std::string& getText() const;
521
525 bool getIsScreenText() const;
526
527 // Retain the derived type when setting generic geometry options.
528 DecorativeText& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
529 DecorativeText& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
530 DecorativeText& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
531 DecorativeText& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
532 DecorativeText& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
533 DecorativeText& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
534 DecorativeText& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
535 DecorativeText& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
536 DecorativeText& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
537 DecorativeText& setFaceCamera(int yn) {DecorativeGeometry::setFaceCamera(yn); return *this;}
539 { DecorativeGeometry::setRepresentation(r); return *this; }
540
542private:
543 class DecorativeTextRep& updRep();
544 const DecorativeTextRep& getRep() const;
545};
546
551public:
552 explicit DecorativeMesh(const PolygonalMesh& mesh);
553 const PolygonalMesh& getMesh() const;
554
555 // Retain the derived type when setting generic geometry options.
556 DecorativeMesh& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
557 DecorativeMesh& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
558 DecorativeMesh& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
559 DecorativeMesh& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
560 DecorativeMesh& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
561 DecorativeMesh& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
562 DecorativeMesh& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
563 DecorativeMesh& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
564 DecorativeMesh& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
566 { DecorativeGeometry::setRepresentation(r); return *this; }
567
569private:
570 class DecorativeMeshRep& updRep();
571 const DecorativeMeshRep& getRep() const;
572};
573
574
581public:
582 explicit DecorativeMeshFile(const std::string& meshFileName);
583 const std::string& getMeshFile() const;
586 const PolygonalMesh& getMesh() const;
587
588 // Retain the derived type when setting generic geometry options.
589 DecorativeMeshFile& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
590 DecorativeMeshFile& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
591 DecorativeMeshFile& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
592 DecorativeMeshFile& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
593 DecorativeMeshFile& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
594 DecorativeMeshFile& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
595 DecorativeMeshFile& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
596 DecorativeMeshFile& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
597 DecorativeMeshFile& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
599 { DecorativeGeometry::setRepresentation(r); return *this; }
600
602private:
603 class DecorativeMeshFileRep& updRep();
604 const DecorativeMeshFileRep& getRep() const;
605};
606
607
614public:
615 explicit DecorativeTorus(Real torusR=1, Real tubeR=0.1);
616
621
622 // Retain the derived type when setting generic geometry options.
623 DecorativeTorus& setBodyId(int b) { DecorativeGeometry::setBodyId(b); return *this; }
624 DecorativeTorus& setIndexOnBody(int x) { DecorativeGeometry::setIndexOnBody(x); return *this; }
625 DecorativeTorus& setUserRef(void* p) { DecorativeGeometry::setUserRef(p); return *this; }
626 DecorativeTorus& setTransform(const Transform& X_BD) { DecorativeGeometry::setTransform(X_BD); return *this; }
627 DecorativeTorus& setResolution(Real r) { DecorativeGeometry::setResolution(r); return *this; }
628 DecorativeTorus& setScaleFactors(const Vec3& s) { DecorativeGeometry::setScaleFactors(s); return *this; }
629 DecorativeTorus& setColor(const Vec3& rgb) { DecorativeGeometry::setColor(rgb); return *this; }
630 DecorativeTorus& setOpacity(Real o) { DecorativeGeometry::setOpacity(o); return *this; }
631 DecorativeTorus& setLineThickness(Real t) { DecorativeGeometry::setLineThickness(t); return *this; }
633 {
634 DecorativeGeometry::setRepresentation(r); return *this;
635 }
636
638private:
639 class DecorativeTorusRep& updRep();
640 const DecorativeTorusRep& getRep() const;
641};
642
643
656public:
657 explicit DecorativeArrow(const Vec3& startPoint = Vec3(0), const Vec3& endPoint = Vec3(1), Real tipLength = 0.35); // Arrow
658 const Vec3& getStartPoint() const;
659 const Vec3& getEndPoint() const;
660 const Real& getTipLength() const;
661
665
666 // Retain the derived type when setting generic geometry options.
667 DecorativeArrow& setBodyId(int b) { DecorativeGeometry::setBodyId(b); return *this; }
668 DecorativeArrow& setIndexOnBody(int x) { DecorativeGeometry::setIndexOnBody(x); return *this; }
669 DecorativeArrow& setUserRef(void* p) { DecorativeGeometry::setUserRef(p); return *this; }
670 DecorativeArrow& setTransform(const Transform& X_BD) { DecorativeGeometry::setTransform(X_BD); return *this; }
671 DecorativeArrow& setResolution(Real r) { DecorativeGeometry::setResolution(r); return *this; }
672 DecorativeArrow& setScaleFactors(const Vec3& s) { DecorativeGeometry::setScaleFactors(s); return *this; }
673 DecorativeArrow& setColor(const Vec3& rgb) { DecorativeGeometry::setColor(rgb); return *this; }
674 DecorativeArrow& setOpacity(Real o) { DecorativeGeometry::setOpacity(o); return *this; }
675 DecorativeArrow& setLineThickness(Real t) { DecorativeGeometry::setLineThickness(t); return *this; }
677 {
678 DecorativeGeometry::setRepresentation(r); return *this;
679 }
680
682private:
683 class DecorativeArrowRep& updRep();
684 const DecorativeArrowRep& getRep() const;
685};
686
687
698public:
699 explicit DecorativeCone(const Vec3& p1 = Vec3(0), const UnitVec3& dir = UnitVec3(1,1,1),
700 Real height = 1.0, Real baseRadius = 0.5); // Cone
701 const Vec3& getOrigin() const;
702 const UnitVec3& getDirection() const;
703 const Real& getHeight() const;
704 const Real& getBaseRadius() const;
705
710
711 // Retain the derived type when setting generic geometry options.
712 DecorativeCone& setBodyId(int b) { DecorativeGeometry::setBodyId(b); return *this; }
713 DecorativeCone& setIndexOnBody(int x) { DecorativeGeometry::setIndexOnBody(x); return *this; }
714 DecorativeCone& setUserRef(void* p) { DecorativeGeometry::setUserRef(p); return *this; }
715 DecorativeCone& setTransform(const Transform& X_BD) { DecorativeGeometry::setTransform(X_BD); return *this; }
716 DecorativeCone& setResolution(Real r) { DecorativeGeometry::setResolution(r); return *this; }
717 DecorativeCone& setScaleFactors(const Vec3& s) { DecorativeGeometry::setScaleFactors(s); return *this; }
718 DecorativeCone& setColor(const Vec3& rgb) { DecorativeGeometry::setColor(rgb); return *this; }
719 DecorativeCone& setOpacity(Real o) { DecorativeGeometry::setOpacity(o); return *this; }
720 DecorativeCone& setLineThickness(Real t) { DecorativeGeometry::setLineThickness(t); return *this; }
722 {
723 DecorativeGeometry::setRepresentation(r); return *this;
724 }
725
727private:
728 class DecorativeConeRep& updRep();
729 const DecorativeConeRep& getRep() const;
730};
731
742public:
747 explicit Decorations(const DecorativeGeometry& decoration);
753 const DecorativeGeometry& decoration);
756 int getNumDecorations() const;
760
761 // Retain the derived type when setting generic geometry options.
762 Decorations& setBodyId(int b) {DecorativeGeometry::setBodyId(b); return *this;}
763 Decorations& setIndexOnBody(int x) {DecorativeGeometry::setIndexOnBody(x); return *this;}
764 Decorations& setUserRef(void* p) {DecorativeGeometry::setUserRef(p); return *this;}
765 Decorations& setTransform(const Transform& X_BD) {DecorativeGeometry::setTransform(X_BD); return *this;}
766 Decorations& setResolution(Real r) {DecorativeGeometry::setResolution(r); return *this;}
767 Decorations& setScaleFactors(const Vec3& s) {DecorativeGeometry::setScaleFactors(s); return *this;}
768 Decorations& setColor(const Vec3& rgb) {DecorativeGeometry::setColor(rgb); return *this;}
769 Decorations& setOpacity(Real o) {DecorativeGeometry::setOpacity(o); return *this;}
770 Decorations& setLineThickness(Real t) {DecorativeGeometry::setLineThickness(t); return *this;}
772 { DecorativeGeometry::setRepresentation(r); return *this; }
773
774
776private:
777 class DecorationsRep& updRep();
778 const DecorationsRep& getRep() const;
779};
780
801
802} // namespace SimTK
803
804#endif // SimTK_SimTKCOMMON_DECORATIVE_GEOMETRY_H_
#define SimTK_SimTKCOMMON_EXPORT
Definition SimTKcommon/include/SimTKcommon/internal/common.h:224
This is the header which should be included in user programs that would like to make use of all the S...
This defines a single DecorativeGeometry object that is composed of a collection of other DecorativeG...
Definition DecorativeGeometry.h:741
Decorations & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:765
Decorations & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:768
Decorations & addDecoration(const Transform &placement, const DecorativeGeometry &decoration)
Add a DecorativeGeometry object to this collection and place it relative to the Decorations frame.
Decorations & setLineThickness(Real t)
Definition DecorativeGeometry.h:770
Decorations & setIndexOnBody(int x)
Definition DecorativeGeometry.h:763
Decorations & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:767
Decorations & setUserRef(void *p)
Definition DecorativeGeometry.h:764
int getNumDecorations() const
Determine how many DecorativeGeometry objects are in this collection.
Decorations & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:771
SimTK_PIMPL_DOWNCAST(Decorations, DecorativeGeometry)
Decorations & setOpacity(Real o)
Definition DecorativeGeometry.h:769
Decorations(const DecorativeGeometry &decoration)
Construct a Decorations container initially consting of just a single DecorativeGeometry object.
Decorations()
Construct an empty container for DecorativeGeometry objects.
const DecorativeGeometry & getDecoration(int i) const
Get access to one of the DecorativeGeometry objects in this collection.
Decorations & setBodyId(int b)
Definition DecorativeGeometry.h:762
Decorations & addDecoration(const DecorativeGeometry &decoration)
Add a DecorativeGeometry object to this collection.
Decorations & setResolution(Real r)
Definition DecorativeGeometry.h:766
An arrow with start point, end point and tip-length.
Definition DecorativeGeometry.h:655
DecorativeArrow & setUserRef(void *p)
Definition DecorativeGeometry.h:669
DecorativeArrow & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:673
const Real & getTipLength() const
DecorativeArrow & setEndPoint(const Vec3 &end)
DecorativeArrow & setTipLength(Real)
DecorativeArrow(const Vec3 &startPoint=Vec3(0), const Vec3 &endPoint=Vec3(1), Real tipLength=0.35)
DecorativeArrow & setStartPoint(const Vec3 &start)
DecorativeArrow & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:676
SimTK_PIMPL_DOWNCAST(DecorativeArrow, DecorativeGeometry)
const Vec3 & getEndPoint() const
const Vec3 & getStartPoint() const
DecorativeArrow & setBodyId(int b)
Definition DecorativeGeometry.h:667
DecorativeArrow & setLineThickness(Real t)
Definition DecorativeGeometry.h:675
DecorativeArrow & setResolution(Real r)
Definition DecorativeGeometry.h:671
DecorativeArrow & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:670
DecorativeArrow & setOpacity(Real o)
Definition DecorativeGeometry.h:674
DecorativeArrow & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:672
DecorativeArrow & setIndexOnBody(int x)
Definition DecorativeGeometry.h:668
This defines a rectangular solid centered at the origin and aligned with the local frame axes.
Definition DecorativeGeometry.h:427
DecorativeBrick & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:438
const Vec3 & getHalfLengths() const
DecorativeBrick & setLineThickness(Real t)
Definition DecorativeGeometry.h:443
DecorativeBrick(const Vec3 &halfLengths=Vec3(Real(0.5)))
DecorativeBrick & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:440
DecorativeBrick & setResolution(Real r)
Definition DecorativeGeometry.h:439
SimTK_PIMPL_DOWNCAST(DecorativeBrick, DecorativeGeometry)
DecorativeBrick & setIndexOnBody(int x)
Definition DecorativeGeometry.h:436
DecorativeBrick & setBodyId(int b)
Definition DecorativeGeometry.h:435
DecorativeBrick & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:441
DecorativeBrick & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:444
DecorativeBrick & setUserRef(void *p)
Definition DecorativeGeometry.h:437
DecorativeBrick & setHalfLengths(const Vec3 &)
DecorativeBrick & setOpacity(Real o)
Definition DecorativeGeometry.h:442
This defines a circle in the x-y plane, centered at the origin.
Definition DecorativeGeometry.h:340
DecorativeCircle & setIndexOnBody(int x)
Definition DecorativeGeometry.h:349
DecorativeCircle & setUserRef(void *p)
Definition DecorativeGeometry.h:350
DecorativeCircle & setLineThickness(Real t)
Definition DecorativeGeometry.h:356
DecorativeCircle & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:357
DecorativeCircle & setOpacity(Real o)
Definition DecorativeGeometry.h:355
DecorativeCircle(Real radius=0.5)
DecorativeCircle & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:353
DecorativeCircle & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:354
DecorativeCircle & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:351
DecorativeCircle & setBodyId(int b)
Definition DecorativeGeometry.h:348
DecorativeCircle & setRadius(Real)
SimTK_PIMPL_DOWNCAST(DecorativeCircle, DecorativeGeometry)
DecorativeCircle & setResolution(Real r)
Definition DecorativeGeometry.h:352
A cone with origin point, direction, height and base radius.
Definition DecorativeGeometry.h:697
DecorativeCone & setBodyId(int b)
Definition DecorativeGeometry.h:712
DecorativeCone & setBaseRadius(Real base)
DecorativeCone & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:717
DecorativeCone & setOpacity(Real o)
Definition DecorativeGeometry.h:719
const UnitVec3 & getDirection() const
const Real & getBaseRadius() const
const Vec3 & getOrigin() const
DecorativeCone & setDirection(const UnitVec3 &direction)
DecorativeCone & setUserRef(void *p)
Definition DecorativeGeometry.h:714
DecorativeCone & setHeight(Real length)
DecorativeCone & setResolution(Real r)
Definition DecorativeGeometry.h:716
DecorativeCone & setOrigin(const Vec3 &origin)
SimTK_PIMPL_DOWNCAST(DecorativeCone, DecorativeGeometry)
DecorativeCone & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:715
DecorativeCone & setLineThickness(Real t)
Definition DecorativeGeometry.h:720
DecorativeCone(const Vec3 &p1=Vec3(0), const UnitVec3 &dir=UnitVec3(1, 1, 1), Real height=1.0, Real baseRadius=0.5)
const Real & getHeight() const
DecorativeCone & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:718
DecorativeCone & setIndexOnBody(int x)
Definition DecorativeGeometry.h:713
DecorativeCone & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:721
This defines a cylinder centered on the origin and aligned in the y direction.
Definition DecorativeGeometry.h:456
DecorativeCylinder & setResolution(Real r)
Definition DecorativeGeometry.h:470
DecorativeCylinder & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:475
DecorativeCylinder & setLineThickness(Real t)
Definition DecorativeGeometry.h:474
DecorativeCylinder & setBodyId(int b)
Definition DecorativeGeometry.h:466
DecorativeCylinder & setHalfHeight(Real)
DecorativeCylinder & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:472
DecorativeCylinder & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:471
DecorativeCylinder & setIndexOnBody(int x)
Definition DecorativeGeometry.h:467
DecorativeCylinder & setRadius(Real)
DecorativeCylinder & setOpacity(Real o)
Definition DecorativeGeometry.h:473
DecorativeCylinder & setUserRef(void *p)
Definition DecorativeGeometry.h:468
DecorativeCylinder(Real radius=0.5, Real halfHeight=0.5)
SimTK_PIMPL_DOWNCAST(DecorativeCylinder, DecorativeGeometry)
DecorativeCylinder & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:469
This defines an ellipsoidal solid centered at the origin and aligned with the local frame axes.
Definition DecorativeGeometry.h:397
DecorativeEllipsoid & setLineThickness(Real t)
Definition DecorativeGeometry.h:414
DecorativeEllipsoid & setIndexOnBody(int x)
Definition DecorativeGeometry.h:407
DecorativeEllipsoid & setBodyId(int b)
Definition DecorativeGeometry.h:406
DecorativeEllipsoid & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:412
DecorativeEllipsoid & setOpacity(Real o)
Definition DecorativeGeometry.h:413
SimTK_PIMPL_DOWNCAST(DecorativeEllipsoid, DecorativeGeometry)
DecorativeEllipsoid & setResolution(Real r)
Definition DecorativeGeometry.h:410
DecorativeEllipsoid & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:411
const Vec3 & getRadii() const
DecorativeEllipsoid & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:409
DecorativeEllipsoid & setRadii(const Vec3 &)
DecorativeEllipsoid(const Vec3 &radii=Vec3(Real(0.5), Real(1/3.), Real(0.25)))
DecorativeEllipsoid & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:415
DecorativeEllipsoid & setUserRef(void *p)
Definition DecorativeGeometry.h:408
This defines geometry to represent a coordinate frame.
Definition DecorativeGeometry.h:487
Real getAxisLength() const
DecorativeFrame & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:500
DecorativeFrame & setIndexOnBody(int x)
Definition DecorativeGeometry.h:496
DecorativeFrame & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:504
SimTK_PIMPL_DOWNCAST(DecorativeFrame, DecorativeGeometry)
DecorativeFrame & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:501
DecorativeFrame & setUserRef(void *p)
Definition DecorativeGeometry.h:497
DecorativeFrame(Real axisLength=1)
DecorativeFrame & setOpacity(Real o)
Definition DecorativeGeometry.h:502
DecorativeFrame & setAxisLength(Real)
DecorativeFrame & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:498
DecorativeFrame & setResolution(Real r)
Definition DecorativeGeometry.h:499
DecorativeFrame & setBodyId(int b)
Definition DecorativeGeometry.h:495
DecorativeFrame & setLineThickness(Real t)
Definition DecorativeGeometry.h:503
Use this abstract class to connect your implementation of decorative geometry to the implementation-i...
Definition DecorativeGeometry.h:783
virtual void implementLineGeometry(const DecorativeLine &)=0
virtual void implementBrickGeometry(const DecorativeBrick &)=0
virtual void implementTextGeometry(const DecorativeText &)=0
virtual void implementMeshGeometry(const DecorativeMesh &)=0
virtual ~DecorativeGeometryImplementation()
Definition DecorativeGeometry.h:785
virtual void implementArrowGeometry(const DecorativeArrow &)=0
virtual void implementPointGeometry(const DecorativePoint &)=0
virtual void implementCircleGeometry(const DecorativeCircle &)=0
virtual void implementMeshFileGeometry(const DecorativeMeshFile &)=0
virtual void implementSphereGeometry(const DecorativeSphere &)=0
virtual void implementFrameGeometry(const DecorativeFrame &)=0
virtual void implementTorusGeometry(const DecorativeTorus &)=0
virtual void implementCylinderGeometry(const DecorativeCylinder &)=0
virtual void implementEllipsoidGeometry(const DecorativeEllipsoid &)=0
virtual void implementConeGeometry(const DecorativeCone &)=0
This is the client-side interface to an implementation-independent representation of "Decorations" su...
Definition DecorativeGeometry.h:87
const DecorativeGeometryRep & getRep() const
Definition DecorativeGeometry.h:259
void implementGeometry(DecorativeGeometryImplementation &) const
DecorativeGeometry()
Default constructor creates an empty handle.
Definition DecorativeGeometry.h:90
void * getUserRef() const
Return the pointer value that was supplied to the most recent setUserRef() call for this DecorativeGe...
DecorativeGeometryRep & updRep()
Definition DecorativeGeometry.h:260
Representation
Drawing modes.
Definition DecorativeGeometry.h:100
Real getLineThickness() const
Return the line thickness specified for this object, if any, otherwise return -1 to indicate that the...
DecorativeGeometry & setBodyId(int bodyId)
By default the geometry should be placed relative to the Ground frame.
DecorativeGeometry(const DecorativeGeometry &source)
Copy construction is deep; the source object will be cloned to create an independent copy.
DecorativeGeometry & setScaleFactors(const Vec3 &scale)
Each concrete DecorativeGeometry object is expected to have a default size around "1",...
DecorativeGeometry & setColor(const Vec3 &rgb)
Request a specific color for this DecorativeGeometry object.
DecorativeGeometry & setFaceCamera(int shouldFace)
Set whether the geometry acts as a billboard, always rotating to face the camera.
DecorativeGeometry & operator=(const DecorativeGeometry &source)
Copy assignment is deep; the handle will be cleared if necessary and then the source object will be c...
Real getResolution() const
Return the current setting of the "resolution" factor.
const Vec3 & getScaleFactors() const
Return the current setting of the "scale" factors.
int getBodyId() const
Return the bodyId that was supplied to the most recent setBodyId() call for this DecorativeGeometry o...
DecorativeGeometry & setRepresentation(const Representation &)
Request a particular rendering representation of this DecorativeGeometry object.
DecorativeGeometry & setResolution(Real)
Each concrete DecorativeGeometry object is expected to have a default resolution that gets the point ...
bool hasRep() const
Definition DecorativeGeometry.h:258
DecorativeGeometry & setOpacity(Real)
Request a level of transparency for this DecorativeGeometry.
DecorativeGeometry & setScale(Real scale)
Convenience method to set all three scale factors to the same value.
Definition DecorativeGeometry.h:172
DecorativeGeometryRep * rep
Definition DecorativeGeometry.h:262
const Vec3 & getColor() const
Return the color specified for this object, if any, otherwise Vec3(-1) indicating that the default co...
Representation getRepresentation() const
Returns drawing mode: -1 means "use default"; see above for others.
DecorativeGeometry & setUserRef(void *userRef)
Use this method to store an arbitrary reference pointer with this DecorativeGeometry object.
DecorativeGeometry & setTransform(const Transform &X_BG)
This transform shifts the generated polygons with respect to this object's local frame.
Real getOpacity() const
Return the opacity specified for this object.
DecorativeGeometry(class DecorativeGeometryRep *r)
Definition DecorativeGeometry.h:257
DecorativeGeometry & setLineThickness(Real)
Request an adjustment to the default rendering of lines and curves.
int getIndexOnBody() const
Return the index that was supplied to the most recent setIndexOnBody() call for this DecorativeGeomet...
const Transform & getTransform() const
Return the current value of the object's transform.
DecorativeGeometry & setIndexOnBody(int index)
For selection or other purposes, you may want to use this method to store an index that can identify ...
int getFaceCamera() const
Get whether the geometry acts as a billboard, always rotating to face the camera.
A line between two points.
Definition DecorativeGeometry.h:307
SimTK_PIMPL_DOWNCAST(DecorativeLine, DecorativeGeometry)
DecorativeLine(const Vec3 &p1=Vec3(0), const Vec3 &p2=Vec3(1))
DecorativeLine & setPoint2(const Vec3 &p2)
DecorativeLine & setBodyId(int b)
Definition DecorativeGeometry.h:317
DecorativeLine & setEndpoints(const Vec3 &p1, const Vec3 &p2)
DecorativeLine & setResolution(Real r)
Definition DecorativeGeometry.h:321
const Vec3 & getPoint2() const
DecorativeLine & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:322
DecorativeLine & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:320
DecorativeLine & setLineThickness(Real t)
Definition DecorativeGeometry.h:325
DecorativeLine & setOpacity(Real o)
Definition DecorativeGeometry.h:324
DecorativeLine & setPoint1(const Vec3 &p1)
const Vec3 & getPoint1() const
DecorativeLine & setUserRef(void *p)
Definition DecorativeGeometry.h:319
DecorativeLine & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:323
DecorativeLine & setIndexOnBody(int x)
Definition DecorativeGeometry.h:318
DecorativeLine & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:326
This defines a displayable mesh by referencing a file name containing the mesh.
Definition DecorativeGeometry.h:580
DecorativeMeshFile & setOpacity(Real o)
Definition DecorativeGeometry.h:596
const std::string & getMeshFile() const
DecorativeMeshFile(const std::string &meshFileName)
DecorativeMeshFile & setBodyId(int b)
Definition DecorativeGeometry.h:589
DecorativeMeshFile & setLineThickness(Real t)
Definition DecorativeGeometry.h:597
DecorativeMeshFile & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:594
DecorativeMeshFile & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:598
DecorativeMeshFile & setUserRef(void *p)
Definition DecorativeGeometry.h:591
DecorativeMeshFile & setIndexOnBody(int x)
Definition DecorativeGeometry.h:590
const PolygonalMesh & getMesh() const
Load the mesh from file and return a reference.
DecorativeMeshFile & setResolution(Real r)
Definition DecorativeGeometry.h:593
DecorativeMeshFile & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:595
SimTK_PIMPL_DOWNCAST(DecorativeMeshFile, DecorativeGeometry)
DecorativeMeshFile & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:592
This defines a displayable mesh by referencing an already-existing PolygonalMesh object.
Definition DecorativeGeometry.h:550
DecorativeMesh & setResolution(Real r)
Definition DecorativeGeometry.h:560
const PolygonalMesh & getMesh() const
DecorativeMesh & setIndexOnBody(int x)
Definition DecorativeGeometry.h:557
DecorativeMesh & setOpacity(Real o)
Definition DecorativeGeometry.h:563
SimTK_PIMPL_DOWNCAST(DecorativeMesh, DecorativeGeometry)
DecorativeMesh & setLineThickness(Real t)
Definition DecorativeGeometry.h:564
DecorativeMesh & setBodyId(int b)
Definition DecorativeGeometry.h:556
DecorativeMesh(const PolygonalMesh &mesh)
DecorativeMesh & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:561
DecorativeMesh & setUserRef(void *p)
Definition DecorativeGeometry.h:558
DecorativeMesh & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:565
DecorativeMesh & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:562
DecorativeMesh & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:559
A point of interest.
Definition DecorativeGeometry.h:270
DecorativePoint & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:286
DecorativePoint & setUserRef(void *p)
Definition DecorativeGeometry.h:282
DecorativePoint & setResolution(Real r)
Definition DecorativeGeometry.h:284
DecorativePoint & setBodyId(int b)
Definition DecorativeGeometry.h:280
DecorativePoint & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:285
DecorativePoint & setIndexOnBody(int x)
Definition DecorativeGeometry.h:281
DecorativePoint & setLineThickness(Real t)
Definition DecorativeGeometry.h:288
const Vec3 & getPoint() const
DecorativePoint & setPoint(const Vec3 &p)
DecorativePoint & setOpacity(Real o)
Definition DecorativeGeometry.h:287
DecorativePoint(const Vec3 &p=Vec3(0))
DecorativePoint & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:283
DecorativePoint & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:289
SimTK_PIMPL_DOWNCAST(DecorativePoint, DecorativeGeometry)
This defines a sphere centered at the origin.
Definition DecorativeGeometry.h:368
DecorativeSphere & setResolution(Real r)
Definition DecorativeGeometry.h:380
SimTK_PIMPL_DOWNCAST(DecorativeSphere, DecorativeGeometry)
DecorativeSphere & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:381
DecorativeSphere & setRadius(Real)
DecorativeSphere(Real radius=0.5)
DecorativeSphere & setIndexOnBody(int x)
Definition DecorativeGeometry.h:377
DecorativeSphere & setLineThickness(Real t)
Definition DecorativeGeometry.h:384
DecorativeSphere & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:379
DecorativeSphere & setUserRef(void *p)
Definition DecorativeGeometry.h:378
DecorativeSphere & setBodyId(int b)
Definition DecorativeGeometry.h:376
DecorativeSphere & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:382
DecorativeSphere & setOpacity(Real o)
Definition DecorativeGeometry.h:383
DecorativeSphere & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:385
This defines a text label with its base at the origin.
Definition DecorativeGeometry.h:515
DecorativeText & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:538
const std::string & getText() const
DecorativeText & setBodyId(int b)
Definition DecorativeGeometry.h:528
DecorativeText & setUserRef(void *p)
Definition DecorativeGeometry.h:530
bool getIsScreenText() const
DecorativeText & setLineThickness(Real t)
Definition DecorativeGeometry.h:536
DecorativeText(const std::string &label="")
DecorativeText & setResolution(Real r)
Definition DecorativeGeometry.h:532
DecorativeText & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:531
DecorativeText & setFaceCamera(int yn)
Definition DecorativeGeometry.h:537
DecorativeText & setOpacity(Real o)
Definition DecorativeGeometry.h:535
DecorativeText & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:534
DecorativeText & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:533
DecorativeText & setIndexOnBody(int x)
Definition DecorativeGeometry.h:529
SimTK_PIMPL_DOWNCAST(DecorativeText, DecorativeGeometry)
DecorativeText & setIsScreenText(bool isScreen)
By default the text is part of the scene; set this flag if you want it to just show up in a fixed spo...
DecorativeText & setText(const std::string &label)
This defines a displayable torus, the torus is centered at the origin with the axial direction aligne...
Definition DecorativeGeometry.h:613
DecorativeTorus & setTorusRadius(Real)
DecorativeTorus(Real torusR=1, Real tubeR=0.1)
DecorativeTorus & setBodyId(int b)
Definition DecorativeGeometry.h:623
DecorativeTorus & setOpacity(Real o)
Definition DecorativeGeometry.h:630
DecorativeTorus & setLineThickness(Real t)
Definition DecorativeGeometry.h:631
SimTK_PIMPL_DOWNCAST(DecorativeTorus, DecorativeGeometry)
DecorativeTorus & setIndexOnBody(int x)
Definition DecorativeGeometry.h:624
Real getTubeRadius() const
DecorativeTorus & setScaleFactors(const Vec3 &s)
Definition DecorativeGeometry.h:628
Real getTorusRadius() const
DecorativeTorus & setColor(const Vec3 &rgb)
Definition DecorativeGeometry.h:629
DecorativeTorus & setTransform(const Transform &X_BD)
Definition DecorativeGeometry.h:626
DecorativeTorus & setRepresentation(const Representation &r)
Definition DecorativeGeometry.h:632
DecorativeTorus & setResolution(Real r)
Definition DecorativeGeometry.h:627
DecorativeTorus & setTubeRadius(Real)
DecorativeTorus & setUserRef(void *p)
Definition DecorativeGeometry.h:625
This class provides a description of a mesh made of polygonal faces (not limited to triangles).
Definition PolygonalMesh.h:79
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
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition Assembler.h:37
constexpr Vec3 Cyan
Definition DecorativeGeometry.h:49
constexpr Vec3 Orange
Definition DecorativeGeometry.h:46
constexpr Vec3 Blue
Definition DecorativeGeometry.h:44
constexpr Vec3 Green
Definition DecorativeGeometry.h:43
constexpr Vec3 White
Definition DecorativeGeometry.h:50
constexpr Vec3 Red
Definition DecorativeGeometry.h:42
constexpr Vec3 Purple
Definition DecorativeGeometry.h:48
constexpr Vec3 Yellow
Definition DecorativeGeometry.h:45
constexpr Vec3 Gray
Definition DecorativeGeometry.h:41
constexpr Vec3 Magenta
Definition DecorativeGeometry.h:47
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:626
constexpr Vec3 Black
Definition DecorativeGeometry.h:40