sprk.h
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef SPRK_H
11 #define SPRK_H
12 
13 #include "hps.h"
14 
15 #include <memory>
16 
17 #ifdef _MSC_VER
18 # pragma warning(disable: 4251) //Not an issue as long as debug and release libraries aren't mixed
19 #ifndef STATIC_APP
20 # ifdef SPRK
21 # define SPRK_API __declspec (dllexport)
22 # else
23 # define SPRK_API __declspec (dllimport)
24 # endif
25 #endif
26 #else
27 # include <stddef.h>
28 # if defined(LINUX_SYSTEM) && defined(SPRK)
29 # ifndef STATIC_APP
30 # define SPRK_API __attribute__ ((visibility ("default")))
31 # endif
32 # endif
33 #endif
34 
35 #ifndef SPRK_API
36 # define SPRK_API
37 #endif
38 namespace SPRKI
39 {
40  class X;
41 };
42 
43 namespace HPS
44 {
45 
46 class Factory;
47 class Canvas;
48 class Layout;
49 class View;
50 class Model;
51 class Operator;
52 class OperatorControl;
53 class NavigationCubeControl;
54 class AxisTriadControl;
55 class Component;
56 class ComponentPath;
57 class ComponentHighlightEvent;
58 class Filter;
59 class Capture;
60 class CADModel;
61 class Metadata;
62 
63 
64 
65 
66 class SPRK_API Sprocket : public HPS::Object
67 {
68 public:
69  Sprocket() {}
70 #if !defined(_MSC_VER) || _MSC_VER >= 1900
71  Sprocket(HPS::Sprocket const & in_that) = default;
72 #endif
73  Sprocket(Sprocket && in_that) : HPS::Object(std::move(in_that)) {}
74 
75  virtual ~Sprocket() {}
76 };
77 
78 typedef std::shared_ptr<Operator> OperatorPtr;
79 
80 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
81 
82 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
83 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
84 typedef std::vector<View, Allocator<View> > ViewArray;
85 typedef std::vector<Model, Allocator<Model> > ModelArray;
86 
87 typedef std::vector<Component, Allocator<Component> > ComponentArray;
88 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
89 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
90 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
91 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
92 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
93 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
94 typedef std::vector<HighlightOptionsKit, Allocator<HighlightOptionsKit>> HighlightOptionsKitArray;
95 
96 
100 class SPRK_API Canvas : public Sprocket
101 {
102 public:
103  Canvas();
104  Canvas(Canvas const & that);
105  ~Canvas();
106 
107  HPS::Type ObjectType() const { return HPS::Type::Canvas; }
108 
110  void Delete();
111 
112  Canvas & operator=(Canvas const & in_that);
113  void Assign(Canvas const & in_that);
114 
115  bool Equals(Canvas const & in_that) const;
116  bool operator!= (Canvas const & in_that) const;
117  bool operator== (Canvas const & in_that) const;
118 
120  UTF8 GetName() const;
121 
125  void AttachLayout(Layout const & in_layout);
126 
130  void AttachViewAsLayout(View const & in_view);
131 
133  void DetachLayout();
134 
136  Layout GetAttachedLayout() const;
137 
139  IncludeKey GetAttachedLayoutIncludeLink() const;
140 
142  View GetFrontView() const;
143 
144  WindowKey const GetWindowKey() const;
145 
148  WindowKey GetWindowKey();
149 
150  PortfolioKey const GetPortfolioKey() const;
151 
153  PortfolioKey GetPortfolioKey();
154 
156  void Update() const;
157 
160  UpdateNotifier UpdateWithNotifier() const;
161 
165  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
166 
171  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
172 
176  void SetFrameRate(float in_frame_rate=20);
177 
181  float GetFrameRate() const;
182 };
183 
184 class SPRK_API Rendering
185 {
186 public:
189  enum class Mode
190  {
191  Gouraud,
192  GouraudWithLines,
193  Flat,
194  FlatWithLines,
195  Phong,
196  PhongWithLines,
197  HiddenLine,
198  FastHiddenLine,
199  Wireframe,
200  Default = Phong
201  };
202 
203 private:
204  Rendering() {}
205 };
206 
207 class SPRK_API SprocketControl : public Sprocket
208 {
209 public:
210  HPS::Type ObjectType() const {return HPS::Type::SprocketControl;}
211 
212 #if !defined(_MSC_VER) || _MSC_VER >= 1900
213  SprocketControl(HPS::SprocketControl const & in_that) = default;
214 #endif
215 
216 protected:
217  SprocketControl() {}
218 
222  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
223 
228  {
229  this->Object::operator=(std::move(in_that));
230  return *this;
231  }
232 };
233 
234 class SPRK_API SprocketKit : public Sprocket
235 {
236 public:
237  HPS::Type ObjectType() const { return HPS::Type::SprocketKit; }
238 
239 #if !defined(_MSC_VER) || _MSC_VER >= 1900
240  SprocketKit(HPS::SprocketKit const & in_that) = default;
241 #endif
242 
243 protected:
244  SprocketKit() {}
245 
249  SprocketKit(SprocketKit && in_that) : Sprocket(std::move(in_that)) {}
250 
255  {
256  this->Object::operator=(std::move(in_that));
257  return *this;
258  }
259 };
260 
264 class SPRK_API View : public Sprocket
265 {
266 public:
267  View();
268  View(View const & that);
269  explicit View(SprocketControl const & in_ctrl);
270  ~View();
271 
272  HPS::Type ObjectType() const { return HPS::Type::View; }
273 
275  void Delete();
276 
277  View & operator=(View const & in_that);
278  void Assign(View const & in_that);
279 
280  bool Equals(View const & in_that) const;
281  bool operator!= (View const & in_that) const;
282  bool operator== (View const & in_that) const;
283 
285  UTF8 GetName() const;
286 
287 
290  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
291 
295  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
296 
297 
301  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
302 
308  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
309 
310 
316  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
317 
318 
320  HPS::View & FitWorld();
321 
324  HPS::View & FitWorld(SegmentKey const & in_segment);
325 
326 
329  HPS::View & FitWorld(BoundingKit const & in_bounding);
330 
335  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
336 
337 
342  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
343 
348  void AttachModel(Model const & in_model);
349 
351  void DetachModel();
352 
354  Model GetAttachedModel() const;
355 
357  IncludeKey GetAttachedModelIncludeLink() const;
358 
362  void SetRenderingMode(Rendering::Mode in_mode);
363 
366  Rendering::Mode GetRenderingMode() const;
367 
369  OperatorPtrArray GetOperators() const;
370 
373  void SetOperators(OperatorPtrArray & in_operators);
374 
378  void SetOperators(size_t in_count, OperatorPtr in_operators []);
379 
382  void SetOperator(OperatorPtr const & in_operator);
383 
386  void SetOperator(Operator * in_operator);
387 
389  OperatorControl GetOperatorControl();
390  OperatorControl const GetOperatorControl() const;
391 
393  NavigationCubeControl GetNavigationCubeControl();
394  NavigationCubeControl const GetNavigationCubeControl() const;
395 
397  AxisTriadControl GetAxisTriadControl();
398  AxisTriadControl const GetAxisTriadControl() const;
399 
402  SegmentKey GetSegmentKey();
403  SegmentKey const GetSegmentKey() const;
404 
407  SegmentKey GetModelOverrideSegmentKey();
408  SegmentKey const GetModelOverrideSegmentKey() const;
409 
410 
411  PortfolioKey const GetPortfolioKey() const;
412 
414  PortfolioKey GetPortfolioKey();
415 
420  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
421 
423  bool GetSimpleShadow();
424 
429  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
430 
432  bool GetSimpleReflection();
433 
435  void Update() const;
436 
439  UpdateNotifier UpdateWithNotifier() const;
440 
444  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
445 
451  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
452 
456  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
457 
458  static UTF8 GetHideStyleName();
459  static UTF8 GetShowStyleName();
460 
462  KeyArray const GetNavigationKeys();
463 
465  LayoutArray GetOwningLayouts();
466  LayoutArray const GetOwningLayouts() const;
467 };
468 
472 class SPRK_API Model : public Sprocket
473 {
474 public:
475  Model();
476  Model(Model const & that);
477  ~Model();
478 
479  HPS::Type ObjectType() const { return HPS::Type::Model; }
480 
482  void Delete();
483 
484  Model & operator=(Model const & in_that);
485  void Assign(Model const & in_that);
486 
487  bool Equals(Model const & in_that) const;
488  bool operator!= (Model const & in_that) const;
489  bool operator== (Model const & in_that) const;
490 
492  UTF8 GetName() const;
493 
496  SegmentKey GetSegmentKey();
497  SegmentKey const GetSegmentKey() const;
498 
500  SegmentKey GetLibraryKey();
501  SegmentKey const GetLibraryKey() const;
502 
504  PortfolioKey GetPortfolioKey();
505  PortfolioKey const GetPortfolioKey() const;
506 
508  HPS::Vector GetUpVector();
509  HPS::Vector const GetUpVector() const;
510 
512  HPS::Vector GetFrontVector();
513  HPS::Vector const GetFrontVector() const;
514 
516  HPS::ViewArray GetOwningViews();
517  HPS::ViewArray const GetOwningViews() const;
518 
522  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
523 
525  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector);
526 
528  void Update() const;
529 
532  UpdateNotifier UpdateWithNotifier() const;
533 
537  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
538 
544  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
545 
546 };
547 
551 class SPRK_API Layout : public Sprocket
552 {
553 public:
554  Layout();
555  Layout(Layout const & that);
556  ~Layout();
557 
558  HPS::Type ObjectType() const { return HPS::Type::Layout; }
559 
561  void Delete();
562 
563  Layout & operator=(Layout const & in_that);
564  void Assign(Layout const & in_that);
565 
566  bool Equals(Layout const & in_that) const;
567  bool operator!= (Layout const & in_that) const;
568  bool operator== (Layout const & in_that) const;
569 
571  UTF8 GetName() const;
572 
574  size_t GetLayerCount() const;
575 
579  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
583  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
584 
587  void DetachLayer(size_t in_layer);
588 
591  void DetachView(View const & in_view); // everywhere it occurs
592 
595  void BringToFront(size_t in_layer);
596 
600  void ReassignLayer(size_t in_layer, HPS::View in_view);
601 
605  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
606 
608  View GetFrontView() const;
609 
613  View GetAttachedView(size_t in_layer = 0) const;
614 
618  Rectangle GetPosition(size_t in_layer) const;
619 
621  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
622 
624  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
625 
629  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
630 
634  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
635 
638  SegmentKey GetSegmentKey();
639  SegmentKey const GetSegmentKey() const;
640 
642  CanvasArray GetOwningCanvases();
643  CanvasArray const GetOwningCanvases() const;
644 
646  void Update() const;
647 
650  UpdateNotifier UpdateWithNotifier() const;
651 
655  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
656 
662  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
663 
664 };
665 
666 class SPRK_API CanvasDeletedEvent : public Event
667 {
668 public:
671  {
672  channel = GetClassID();
673  consumable = false;
674  }
675 
676  CanvasDeletedEvent(Canvas const & in_canvas)
677  : Event(), canvas(in_canvas)
678  {
679  channel = GetClassID();
680  consumable = false;
681  }
682 
685  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
686  {
687  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
688  {
689  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
690  canvas = that.canvas;
691  }
692  else
693  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
694  }
695 
697 
700  Event * Clone() const
701  {
702  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
703  return new_event;
704  }
705 
706  Canvas canvas;
707 };
708 
709 class SPRK_API LayoutDetachedEvent : public Event
710 {
711 public:
714  {
715  channel = GetClassID();
716  consumable = false;
717  }
718 
719  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
720  : Event(), canvas(in_canvas), layout(in_layout)
721  {
722  channel = GetClassID();
723  consumable = false;
724  }
725 
728  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
729  {
730  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
731  {
732  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
733  canvas = that.canvas;
734  layout = that.layout;
735  }
736  else
737  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
738  }
739 
741 
744  Event * Clone() const
745  {
746  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
747  return new_event;
748  }
749 
750  Canvas canvas;
751  Layout layout;
752 };
753 
754 class SPRK_API LayoutDeletedEvent : public Event
755 {
756 public:
759  {
760  channel = GetClassID();
761  consumable = false;
762  }
763 
764  LayoutDeletedEvent(Layout const & in_layout)
765  : Event(), layout(in_layout)
766  {
767  channel = GetClassID();
768  consumable = false;
769  }
770 
773  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
774  {
775  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
776  {
777  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
778  layout = that.layout;
779  }
780  else
781  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
782  }
783 
785 
788  Event * Clone() const
789  {
790  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
791  return new_event;
792  }
793 
794  Layout layout;
795 };
796 
797 class SPRK_API ViewDetachedEvent : public Event
798 {
799 public:
800  enum class Action
801  {
802  None = 0,
803  SpecificLayer,
804  AllLayers,
805  };
806 
808  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
809  {
810  channel = GetClassID();
811  consumable = false;
812  }
813 
814  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
815  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
816  {
817  channel = GetClassID();
818  consumable = false;
819  }
820 
821  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
822  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
823  {
824  channel = GetClassID();
825  consumable = false;
826  }
827 
830  ViewDetachedEvent(Event const & in_event) : Event(in_event)
831  {
832  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
833  {
834  auto that = static_cast<ViewDetachedEvent const &>(in_event);
835  layout = that.layout;
836  action = that.action;
837  layer = that.layer;
838  view = that.view;
839  }
840  else
841  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
842  }
843 
845 
848  Event * Clone() const
849  {
850  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
851  return new_event;
852  }
853 
854  Layout layout;
855  Action action;
856  size_t layer;
857  View view;
858 };
859 
860 class SPRK_API ViewDeletedEvent : public Event
861 {
862 public:
865  {
866  channel = GetClassID();
867  consumable = false;
868  }
869 
870  ViewDeletedEvent(View const & in_view)
871  : Event(), view(in_view)
872  {
873  channel = GetClassID();
874  consumable = false;
875  }
876 
879  ViewDeletedEvent(Event const & in_event) : Event(in_event)
880  {
881  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
882  {
883  auto that = static_cast<ViewDeletedEvent const &>(in_event);
884  view = that.view;
885  }
886  else
887  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
888  }
889 
890  ~ViewDeletedEvent();
891 
894  Event * Clone() const
895  {
896  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
897  return new_event;
898  }
899 
900  View view;
901 };
902 
903 class SPRK_API ModelDetachedEvent : public Event
904 {
905 public:
908  {
909  channel = GetClassID();
910  consumable = false;
911  }
912 
913  ModelDetachedEvent(View const & in_view, Model const & in_model)
914  : Event(), view(in_view), model(in_model)
915  {
916  channel = GetClassID();
917  consumable = false;
918  }
919 
922  ModelDetachedEvent(Event const & in_event) : Event(in_event)
923  {
924  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
925  {
926  auto that = static_cast<ModelDetachedEvent const &>(in_event);
927  view = that.view;
928  model = that.model;
929  }
930  else
931  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
932  }
933 
935 
938  Event * Clone() const
939  {
940  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
941  return new_event;
942  }
943 
944  View view;
945  Model model;
946 };
947 
948 class SPRK_API ModelDeletedEvent : public Event
949 {
950 public:
953  {
954  channel = GetClassID();
955  consumable = false;
956  }
957 
958  ModelDeletedEvent(Model const & in_model)
959  : Event(), model(in_model)
960  {
961  channel = GetClassID();
962  consumable = false;
963  }
964 
967  ModelDeletedEvent(Event const & in_event) : Event(in_event)
968  {
969  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
970  {
971  auto that = static_cast<ModelDeletedEvent const &>(in_event);
972  model = that.model;
973  }
974  else
975  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
976  }
977 
979 
982  Event * Clone() const
983  {
984  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
985  return new_event;
986  }
987 
988  Model model;
989 };
990 
991 class SPRK_API CameraChangedEvent : public Event
992 {
993 public:
996  {
997  channel = GetClassID();
998  consumable = false;
999  }
1000 
1001  CameraChangedEvent(View const & in_view)
1002  : Event(), view(in_view)
1003  {
1004  channel = GetClassID();
1005  consumable = false;
1006  }
1007 
1010  CameraChangedEvent(Event const & in_event) : Event(in_event)
1011  {
1012  if (in_event.GetChannel() == Object::ClassID<CameraChangedEvent>())
1013  {
1014  auto that = static_cast<CameraChangedEvent const &>(in_event);
1015  view = that.view;
1016  }
1017  else
1018  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
1019  }
1020 
1021  ~CameraChangedEvent();
1022 
1023  virtual bool Drop(Event const * in_that_event) const
1024  {
1025  CameraChangedEvent const * that_event = static_cast<CameraChangedEvent const *>(in_that_event);
1026 
1027  if (view == that_event->view)
1028  return true;
1029 
1030  return false;
1031  }
1032 
1033  virtual intptr_t Freshen() const
1034  {
1035  return GetClassID();
1036  }
1037 
1040  Event * Clone() const
1041  {
1042  CameraChangedEvent * new_event = new CameraChangedEvent(*this);
1043  return new_event;
1044  }
1045 
1046  View view;
1047 };
1048 
1051 class SPRK_API SprocketPath : public Sprocket
1052 {
1053 public:
1054  SprocketPath();
1055  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
1056  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
1057  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
1058  SprocketPath(SprocketPath const & that);
1059  ~SprocketPath();
1060 
1061  HPS::Type ObjectType() const { return HPS::Type::SprocketPath; }
1062 
1063  SprocketPath & operator=(SprocketPath const & in_that);
1064  void Set(SprocketPath const & in_that);
1065 
1066  bool Equals(SprocketPath const & in_that) const;
1067  bool operator!= (SprocketPath const & in_that) const;
1068  bool operator== (SprocketPath const & in_that) const;
1069 
1071  Canvas GetCanvas() const;
1072 
1074  Layout GetLayout() const;
1075 
1077  View GetView() const;
1078 
1080  Model GetModel() const;
1081 
1086  KeyPath GetKeyPath() const;
1087 };
1088 
1089 
1092 class SPRK_API Operator : public Sprocket
1093 {
1094 public:
1095  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1096  Operator(Operator const & in_that);
1097 
1098  virtual ~Operator();
1099 
1100  HPS::Type ObjectType() const { return HPS::Type::Operator; }
1101 
1102  virtual Operator & operator= (Operator const & in_that);
1103 
1105  virtual void Assign(Operator const & in_that);
1106 
1108  virtual bool Equals(Operator const & in_that) const;
1109 
1111  virtual bool operator!= (Operator const & in_that) const;
1112 
1114  virtual bool operator== (Operator const & in_that) const;
1115 
1117  void DetachView();
1118 
1120  View GetAttachedView() const;
1121 
1123  virtual UTF8 GetName() const { return "Operator"; }
1124 
1128  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1129 
1133  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1134 
1138  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1139 
1143  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1144 
1148  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1149 
1153  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1154 
1158  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1159 
1163  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1164 
1168  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1169 
1173  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1174 
1178  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1179 
1183  virtual bool OnTextInput(HPS::UTF8 const & in_text) { HPS_UNREFERENCED(in_text); return false; }
1184 
1188  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1189 
1191  virtual void OnViewAttached() { return; }
1192 
1194  virtual void OnViewDetached() { return; }
1195 
1198  virtual void OnModelAttached() { return; }
1199 
1202  virtual void OnModelDetached() { return; }
1203 
1205  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1206 
1209  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1210 
1214  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1215 
1217  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1218 
1220  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1221 
1222  enum class Priority
1223  {
1224  Low,
1225  Default,
1226  High
1227  };
1228 
1229 protected:
1230 
1231  HPS::MouseButtons mouse_trigger;
1232  HPS::ModifierKeys modifier_trigger;
1233 };
1234 
1235 class SPRK_API OperatorUtility
1236 {
1237  static double internal_acos(double x)
1238  {
1239  return (((x)<-1) ? (HPS::PI) : (((x)>1) ? (0) : (acos(x))));
1240  }
1241 
1242 public:
1243 
1244  enum ProjectedPlane
1245  {
1246  Plane_XY,
1247  Plane_YZ,
1248  Plane_XZ
1249  };
1250 
1251  static void ScreenToSphereMousePoint(HPS::Point const &in_pt, HPS::Vector &out_vec)
1252  {
1253  out_vec = HPS::Vector(in_pt);
1254  float len = static_cast<float>(out_vec.Length());
1255  if (len > 1.0f)
1256  {
1257  out_vec /= len;
1258  out_vec.z = 0;
1259  }
1260  else
1261  out_vec.z = (float)sqrt(1.0f - (len*len));
1262  }
1263 
1264  static float CalculateAngleOrbitOnPlane(HPS::Vector const &axis, ProjectedPlane plane)
1265  {
1266  float theta;
1267 
1268  HPS::Vector vtmp;
1269  if (plane == Plane_XY)
1270  vtmp = HPS::Vector(axis.x, axis.y, 0);
1271  else if (plane == Plane_YZ)
1272  vtmp = HPS::Vector(0, axis.y, axis.z);
1273  else
1274  vtmp = HPS::Vector(axis.x, 0, axis.z);
1275  Vector naxis = axis;
1276 
1277  naxis.Normalize();
1278  vtmp.Normalize();
1279 
1280  float tmp = naxis.Dot(vtmp);
1281  if (static_cast<float>(Abs(tmp)) > 1.001f || static_cast<float>(Abs(tmp)) < 0.999f)
1282  theta = static_cast<float>(internal_acos(tmp));
1283  else
1284  theta = 0.0f;
1285 
1286  return theta;
1287  }
1288 };
1289 
1292 class SPRK_API OperatorControl : public SprocketControl
1293 {
1294 public:
1296  explicit OperatorControl(View const & in_view);
1297 
1299  OperatorControl(OperatorControl const & in_that);
1300 
1304  OperatorControl(OperatorControl && in_that);
1305 
1309  OperatorControl & operator=(OperatorControl && in_that);
1310 
1312  ~OperatorControl();
1313 
1314  HPS::Type ObjectType() const {return HPS::Type::OperatorControl;};
1315 
1317  OperatorControl & operator=(OperatorControl const & in_that);
1318 
1319 
1321  size_t GetCount();
1322 
1325  size_t GetCount(Operator::Priority in_priority);
1326 
1327 
1333  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1334 
1340  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1341 
1345  bool Pop(Operator::Priority in_priority = Operator::Priority::Default);
1346 
1351  bool Pop(OperatorPtr & out_operator);
1352 
1358  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1359 
1360 
1366  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1367 
1373  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1374 
1380  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Default);
1381 
1388  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Default);
1389 
1390 
1394  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Default);
1395 
1399  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1400 
1403  OperatorControl & UnsetEverything();
1404 
1405 
1409  bool ShowTop(OperatorPtr & out_operator) const;
1410 
1415  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1416 
1420  bool Show(OperatorPtrArray & out_operators) const;
1421 
1426  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1427 
1428 private:
1430  OperatorControl() {}
1431 };
1432 
1436 {
1437 public:
1438 
1439  enum class Location
1440  {
1441  TopRight,
1442  TopLeft,
1443  BottomRight,
1444  BottomLeft,
1445  Custom,
1446  };
1447 
1449  explicit NavigationCubeControl(View const & in_view);
1450 
1453 
1458 
1462  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1463 
1466 
1467  HPS::Type ObjectType() const {return HPS::Type::NavigationCubeControl;};
1468 
1470  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1471 
1480  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1481 
1484  Location GetLocation() const;
1485 
1489  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1490 
1493  HPS::Rectangle GetPosition() const;
1494 
1498  NavigationCubeControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1499 
1502  HPS::IntRectangle GetPositionOffsets() const;
1503 
1508  NavigationCubeControl & SetVisibility(bool in_visibility);
1509 
1512  bool GetVisibility() const;
1513 
1517  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1518 
1521  bool GetTextVisibility() const;
1522 
1537  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1538 
1541  HPS::UTF8 GetMaterialPalette() const;
1542 
1550  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1551 
1552 
1555  bool GetInteractivity() const;
1556 
1561  NavigationCubeControl & SetSize(float in_size);
1562 
1565  float GetSize() const;
1566 
1569  HPS::SegmentKey GetSegmentKey() const;
1570 
1571 private:
1574 
1576  HPS::SegmentKey GetNavigationCubeSegment() const;
1577 };
1578 
1581 class SPRK_API AxisTriadControl : public SprocketControl
1582 {
1583 public:
1584 
1585  enum class Location
1586  {
1587  TopRight,
1588  TopLeft,
1589  BottomRight,
1590  BottomLeft,
1591  Custom,
1592  };
1593 
1595  explicit AxisTriadControl(View const & in_view);
1596 
1598  AxisTriadControl(AxisTriadControl const & in_that);
1599 
1603  AxisTriadControl(AxisTriadControl && in_that);
1604 
1608  AxisTriadControl & operator=(AxisTriadControl && in_that);
1609 
1611  ~AxisTriadControl();
1612 
1613  HPS::Type ObjectType() const {return HPS::Type::AxisTriadControl;};
1614 
1616  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1617 
1626  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_position = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1627 
1630  Location GetLocation() const;
1631 
1635  AxisTriadControl & SetPosition(HPS::Rectangle const & in_position);
1636 
1639  HPS::Rectangle GetPosition() const;
1640 
1644  AxisTriadControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1645 
1648  HPS::IntRectangle GetPositionOffsets() const;
1649 
1654  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1655 
1658  bool GetVisibility() const;
1659 
1663  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1664 
1667  bool GetTextVisibility() const;
1668 
1677  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1678 
1681  HPS::UTF8 GetMaterialPalette() const;
1682 
1689  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1690 
1693  bool GetInteractivity() const;
1694 
1699  AxisTriadControl & SetSize(float in_size);
1700 
1703  float GetSize() const;
1704 
1707  HPS::SegmentKey GetSegmentKey() const;
1708 
1709 private:
1711  AxisTriadControl(){};
1712 
1714  HPS::SegmentKey GetAxisTriadSegment() const;
1715 };
1716 
1718 class SPRK_API Component : public Sprocket
1719 {
1720 public:
1723  enum class ComponentType : uint32_t
1724  {
1725  None = 0x00000000,
1726  GenericMask = 0xfffff000,
1727 
1728  ExchangeComponentMask = 0x00001000,
1729  ExchangeModelFile = 0x00001001,
1730  ExchangeProductOccurrence = 0x00001002,
1731  ExchangePartDefinition = 0x00001003,
1732 
1733  ExchangeView = 0x00001004,
1734  ExchangeFilter = 0x00001005,
1735 
1736  ExchangeRepresentationItemMask = 0x00003000,
1737  ExchangeRIBRepModel = 0x00003001,
1738  ExchangeRICurve = 0x00003002,
1739  ExchangeRIDirection = 0x00003003,
1740  ExchangeRIPlane = 0x00003004,
1741  ExchangeRIPointSet = 0x00003005,
1742  ExchangeRIPolyBRepModel = 0x00003006,
1743  ExchangeRIPolyWire = 0x00003007,
1744  ExchangeRISet = 0x00003008,
1745  ExchangeRICoordinateSystem = 0x00003009,
1746 
1747  ExchangeTopologyMask = 0x00005000,
1748  ExchangeTopoBody = 0x00005001,
1749  ExchangeTopoConnex = 0x00005002,
1750  ExchangeTopoShell = 0x00005003,
1751  ExchangeTopoFace = 0x00005004,
1752  ExchangeTopoLoop = 0x00005005,
1753  ExchangeTopoCoEdge = 0x00005006,
1754  ExchangeTopoEdge = 0x00005007,
1755  ExchangeTopoVertex = 0x00005008,
1756  ExchangeTopoSingleWireBody = 0x00005009,
1757  ExchangeTopoWireEdge = 0x0000500a,
1758 
1759  ExchangeDrawingMask = 0x00009000,
1760  ExchangeDrawingModel = 0x00009001,
1761  ExchangeDrawingView = 0x00009002,
1762  ExchangeDrawingSheet = 0x00009003,
1763  ExchangeBasicDrawingBlock = 0x00009004,
1764  ExchangeOperatorDrawingBlock = 0x00009005,
1765 
1766  ExchangePMIMask = 0x00011000,
1767  ExchangePMI = ExchangePMIMask,
1768  ExchangePMIText = 0x00011100,
1769  ExchangePMIRichText = 0x00011200,
1770  ExchangePMIRoughness = 0x00011300,
1771  ExchangePMIGDT = 0x00011400,
1772  ExchangePMIDatum = 0x00011500,
1773  ExchangePMILineWelding = 0x00011600,
1774  ExchangePMISpotWelding = 0x00011700,
1775  ExchangePMIDimension = 0x00011800,
1776  ExchangePMIBalloon = 0x00011900,
1777  ExchangePMICoordinate = 0x00011a00,
1778  ExchangePMIFastener = 0x00011b00,
1779  ExchangePMILocator = 0x00011c00,
1780  ExchangePMIMeasurementPoint = 0x00011d00,
1781 
1782 
1783  ParasolidComponentMask = 0x00020000,
1784 
1785  ParasolidModelFile = 0x00020001,
1786  ParasolidAssembly = 0x00020002,
1787  ParasolidInstance = 0x00020003,
1788 
1789  ParasolidTopologyMask = 0x00060000,
1790  ParasolidTopoBody = 0x00060001,
1791  ParasolidTopoRegion = 0x00060002,
1792  ParasolidTopoShell = 0x00060003,
1793  ParasolidTopoFace = 0x00060004,
1794  ParasolidTopoLoop = 0x00060005,
1795  ParasolidTopoFin = 0x00060006,
1796  ParasolidTopoEdge = 0x00060007,
1797  ParasolidTopoVertex = 0x00060008,
1798 
1799 
1800  DWGComponentMask = 0x00100000,
1801  DWGModelFile = 0x00100001,
1802  DWGLayout = 0x00100002,
1803  DWGBlockTable = 0x00100003,
1804  DWGBlockTableRecord = 0x00100004,
1805  DWGEntity = 0x00100005,
1806  DWGLayerTable = 0x00100006,
1807  DWGLayer = 0x00100007,
1808 
1809 
1810  UserComponent = 0x01000000,
1811  };
1812 
1813 
1815  Component();
1816 
1819  Component(Component const & in_that);
1820 
1823  Component(Component && in_that);
1824 
1826  virtual ~Component();
1827 
1828  HPS::Type ObjectType() const { return HPS::Type::Component; }
1829 
1830 
1834  Component & operator=(Component const & in_that);
1835 
1839  Component & operator=(Component && in_that);
1840 
1844  virtual void Assign(Component const & in_that);
1845 
1849  bool Equals(Component const & in_that) const;
1850 
1854  bool operator!=(Component const & in_that) const;
1855 
1859  bool operator==(Component const & in_that) const;
1860 
1861 
1864  ComponentType GetComponentType() const;
1865 
1869  bool HasComponentType(ComponentType in_mask) const;
1870 
1871 
1872 
1878  void AddKey(Key const & in_key);
1879 
1882  KeyArray GetKeys() const;
1883 
1884 
1885 
1890  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1891 
1895  ComponentArray GetOwners() const;
1896 
1899  ComponentArray GetSubcomponents() const;
1900 
1905  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1906 
1907 
1908 
1911  void AddReference(Component & in_reference);
1912 
1915  ComponentArray GetReferrers() const;
1916 
1920  ComponentArray GetReferences() const;
1921 
1922 
1923 
1926  MetadataArray GetAllMetadata() const;
1927 
1931  Metadata GetMetadata(char const * in_name) const;
1932 
1936  UTF8 GetName() const;
1937 
1938 
1939 
1992  void Delete();
1993 
1997  void Flush();
1998 
1999 
2007  static KeyPathArray GetKeyPath(Component const & in_component);
2008 
2018  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
2019 
2028  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
2029 };
2030 
2032 class SPRK_API ComponentPath : public Sprocket
2033 {
2034 public:
2036  ComponentPath();
2037 
2040  ComponentPath(ComponentArray const & in_components);
2041 
2045  ComponentPath(size_t in_count, Component const in_components[]);
2046 
2048  ComponentPath(ComponentPath const & in_that);
2049 
2053  ComponentPath(ComponentPath && in_that);
2054 
2058  ComponentPath & operator=(ComponentPath && in_that);
2059 
2061  virtual ~ComponentPath();
2062 
2063  HPS::Type ObjectType() const { return HPS::Type::ComponentPath; }
2064 
2068  ComponentPath & operator+=(Component const & in_component);
2069 
2073  ComponentPath & operator+=(ComponentPath const & in_path);
2074 
2078  ComponentPath & operator+=(ComponentArray const & in_components);
2079 
2083  ComponentPath & Append(Component const & in_component);
2084 
2088  ComponentPath & Append(ComponentPath const & in_path);
2089 
2093  ComponentPath & Append(ComponentArray const & in_components);
2094 
2098  ComponentPath & operator=(ComponentPath const & in_that);
2099 
2103  ComponentPath & operator=(ComponentArray const & in_path);
2104 
2107  void Set(ComponentPath const & in_that);
2108 
2112  bool Equals(ComponentPath const & in_that) const;
2113 
2117  bool operator!= (ComponentPath const & in_that) const;
2118 
2122  bool operator== (ComponentPath const & in_that) const;
2123 
2124 
2128  ComponentPath & SetComponents(ComponentArray const & in_components);
2129 
2134  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
2135 
2138  ComponentArray GetComponents() const;
2139 
2143  KeyPathArray GetKeyPaths() const;
2144 
2149  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
2150 
2151 
2155  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
2156 
2161  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
2162 
2166  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2167 
2172  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2173 
2174 
2178  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2179 
2183  void Show(Canvas const & in_canvas, size_t in_layer = 0);
2184 
2190  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
2191 
2195  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
2196 
2197  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0);
2198 };
2199 
2200 
2205 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2206 {
2207  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2208 }
2209 
2214 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2215 {
2216  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2217 }
2218 
2223 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2224 {
2225  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2226 }
2227 
2232 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2233 {
2234  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2235 }
2236 
2241 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2242 {
2243  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2244 }
2245 
2250 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2251 {
2252  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2253 }
2254 
2259 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2260 {
2261  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2262 }
2263 
2268 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2269 {
2270  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2271 }
2272 
2277 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2278 {
2279  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2280 }
2281 
2282 
2284 class SPRK_API ComponentHighlightEvent : public Event
2285 {
2286 public:
2287  enum class Action
2288  {
2289  None = 0,
2290  Highlight,
2291  Unhighlight,
2292  };
2293 
2296  {
2297  channel = GetClassID();
2298  consumable = false;
2299  action = Action::None;
2300  }
2301 
2302  ComponentHighlightEvent(Action in_action,
2303  ComponentPath const & in_path = ComponentPath(),
2304  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2305  : Event(), action(in_action), path(in_path), options(in_options)
2306  {
2307  channel = GetClassID();
2308  consumable = false;
2309  }
2310 
2313  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2314  {
2315  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2316  {
2317  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2318  action = that.action;
2319  path = that.path;
2320  options = that.options;
2321  }
2322  else
2323  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2324  }
2325 
2327 
2330  Event * Clone() const
2331  {
2332  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2333  return new_event;
2334  }
2335 
2336  Action action;
2337  ComponentPath path;
2338  HighlightOptionsKit options;
2339 };
2340 
2341 
2343 class SPRK_API Filter : public Component
2344 {
2345 public:
2347  Filter();
2348 
2352  Filter(Component const & in_that);
2353 
2356  Filter(Filter const & in_that);
2357 
2360  Filter(Filter && in_that);
2361 
2362  virtual ~Filter();
2363 
2364  HPS::Type ObjectType() const { return HPS::Type::Filter; }
2365 
2366 
2367 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2368  Filter & operator=(Filter const & in_that) = default;
2369 #endif
2370 
2374  Filter & operator=(Filter && in_that);
2375 
2376 
2379  void Activate(View const & in_view);
2380 
2383  void Deactivate(View const & in_view);
2384 };
2385 
2386 
2387 class SPRK_API FilterActivationEvent : public Event
2388 {
2389 public:
2390  enum class Action
2391  {
2392  None = 0,
2393  Activate,
2394  Deactivate,
2395  };
2396 
2399  {
2400  channel = GetClassID();
2401  consumable = false;
2402  }
2403 
2404  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2405  {
2406  channel = GetClassID();
2407  consumable = false;
2408  }
2409 
2412  FilterActivationEvent(Event const & in_event) : Event(in_event)
2413  {
2414  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2415  {
2416  auto that = static_cast<FilterActivationEvent const &>(in_event);
2417  filter = that.filter;
2418  action = that.action;
2419  view = that.view;
2420  }
2421  else
2422  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2423  }
2424 
2426 
2429  Event * Clone() const
2430  {
2431  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2432  return new_event;
2433  }
2434 
2435  Filter filter;
2436  Action action;
2437  View view;
2438 };
2439 
2440 
2442 class SPRK_API Capture : public Component
2443 {
2444 public:
2446  Capture();
2447 
2451  Capture(Component const & in_that);
2452 
2455  Capture(Capture const & in_that);
2456 
2459  Capture(Capture && in_that);
2460 
2461  virtual ~Capture();
2462 
2463  HPS::Type ObjectType() const { return HPS::Type::Capture; }
2464 
2465 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2466  Capture & operator=(Capture const & in_that) = default;
2467 #endif
2468 
2472  Capture & operator=(Capture && in_that);
2473 
2474 
2478  View Activate();
2479 };
2480 
2481 
2482 class SPRK_API CaptureActivationEvent : public Event
2483 {
2484 public:
2487  {
2488  channel = GetClassID();
2489  consumable = false;
2490  }
2491 
2492  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2493  {
2494  channel = GetClassID();
2495  consumable = false;
2496  }
2497 
2500  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2501  {
2502  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2503  {
2504  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2505  capture = that.capture;
2506  view = that.view;
2507  }
2508  else
2509  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2510  }
2511 
2513 
2516  Event * Clone() const
2517  {
2518  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2519  return new_event;
2520  }
2521 
2522  Capture capture;
2523  View view;
2524 };
2525 
2526 
2528 class SPRK_API CADModel : public Component
2529 {
2530 public:
2532  CADModel();
2533 
2537  CADModel(Component const & in_that);
2538 
2541  CADModel(CADModel const & in_that);
2542 
2545  CADModel(CADModel && in_that);
2546 
2549  CADModel(Model const & in_that);
2550 
2551  virtual ~CADModel();
2552 
2553  HPS::Type ObjectType() const { return HPS::Type::CADModel; }
2554 
2555 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2556  CADModel & operator=(CADModel const & in_that) = default;
2557 #endif
2558 
2562  CADModel & operator=(CADModel && in_that);
2563 
2564 
2568  Component GetComponentFromKey(Key const & in_key) const;
2569 
2574  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2575 
2581  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2582 
2583 
2586  Model GetModel() const;
2587 
2590  FilterArray GetAllFilters() const;
2591 
2594  CaptureArray GetAllCaptures() const;
2595 
2599  FilterArray GetActiveFilters(View const & in_view) const;
2600 
2601 
2605  View ActivateDefaultCapture();
2606 
2607 
2615  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2616 };
2617 
2618 
2619 
2622 class SPRK_API Metadata : public Sprocket
2623 {
2624 public:
2626  Metadata();
2627 
2630  Metadata(Metadata const & in_that);
2631 
2634  Metadata(Metadata && in_that);
2635 
2638  Metadata(char const * in_name);
2639 
2640  virtual ~Metadata();
2641 
2642  HPS::Type ObjectType() const { return HPS::Type::Metadata; }
2643 
2644 
2648  Metadata & operator=(Metadata const & in_that);
2649 
2653  Metadata & operator=(Metadata && in_that);
2654 
2658  virtual void Assign(Metadata const & in_that);
2659 
2663  bool Equals(Metadata const & in_that) const;
2664 
2668  bool operator!=(Metadata const & in_that) const;
2669 
2673  bool operator==(Metadata const & in_that) const;
2674 
2675 
2678  HPS::UTF8 GetName() const;
2679 
2682  void SetName(char const * in_name);
2683 };
2684 
2686 class SPRK_API IntegerMetadata : public Metadata
2687 {
2688 public:
2690  IntegerMetadata();
2691 
2695  IntegerMetadata(Metadata const & in_that);
2696 
2699  IntegerMetadata(IntegerMetadata const & in_that);
2700 
2703  IntegerMetadata(IntegerMetadata && in_that);
2704 
2708  IntegerMetadata(char const * in_name, int in_value);
2709 
2710  virtual ~IntegerMetadata();
2711 
2712  HPS::Type ObjectType() const { return HPS::Type::IntegerMetadata; }
2713 
2714 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2715  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2716 #endif
2717 
2721  IntegerMetadata & operator=(IntegerMetadata && in_that);
2722 
2723 
2726  int GetValue() const;
2727 
2730  void SetValue(int in_value);
2731 };
2732 
2734 class SPRK_API UnsignedIntegerMetadata : public Metadata
2735 {
2736 public:
2739 
2743  UnsignedIntegerMetadata(Metadata const & in_that);
2744 
2748 
2752 
2756  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2757 
2758  virtual ~UnsignedIntegerMetadata();
2759 
2760  HPS::Type ObjectType() const { return HPS::Type::UnsignedIntegerMetadata; }
2761 
2762 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2763  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2764 #endif
2765 
2769  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2770 
2771 
2774  unsigned int GetValue() const;
2775 
2778  void SetValue(unsigned int in_value);
2779 };
2780 
2782 class SPRK_API DoubleMetadata : public Metadata
2783 {
2784 public:
2786  DoubleMetadata();
2787 
2791  DoubleMetadata(Metadata const & in_that);
2792 
2795  DoubleMetadata(DoubleMetadata const & in_that);
2796 
2799  DoubleMetadata(DoubleMetadata && in_that);
2800 
2804  DoubleMetadata(char const * in_name, double in_value);
2805 
2806  virtual ~DoubleMetadata();
2807 
2808  HPS::Type ObjectType() const { return HPS::Type::DoubleMetadata; }
2809 
2810 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2811  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2812 #endif
2813 
2817  DoubleMetadata & operator=(DoubleMetadata && in_that);
2818 
2819 
2822  double GetValue() const;
2823 
2826  void SetValue(double in_value);
2827 };
2828 
2830 class SPRK_API StringMetadata : public Metadata
2831 {
2832 public:
2834  StringMetadata();
2835 
2839  StringMetadata(Metadata const & in_that);
2840 
2843  StringMetadata(StringMetadata const & in_that);
2844 
2847  StringMetadata(StringMetadata && in_that);
2848 
2852  StringMetadata(char const * in_name, char const * in_value);
2853 
2854  virtual ~StringMetadata();
2855 
2856  HPS::Type ObjectType() const { return HPS::Type::StringMetadata; }
2857 
2858 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2859  StringMetadata & operator=(StringMetadata const & in_that) = default;
2860 #endif
2861 
2865  StringMetadata & operator=(StringMetadata && in_that);
2866 
2867 
2870  UTF8 GetValue() const;
2871 
2874  void SetValue(char const * in_value);
2875 };
2876 
2878 class SPRK_API TimeMetadata : public Metadata
2879 {
2880 public:
2882  TimeMetadata();
2883 
2887  TimeMetadata(Metadata const & in_that);
2888 
2891  TimeMetadata(TimeMetadata const & in_that);
2892 
2895  TimeMetadata(TimeMetadata && in_that);
2896 
2900  TimeMetadata(char const * in_name, unsigned int in_value);
2901 
2902  virtual ~TimeMetadata();
2903 
2904  HPS::Type ObjectType() const { return HPS::Type::TimeMetadata; }
2905 
2906 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2907  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
2908 #endif
2909 
2913  TimeMetadata & operator=(TimeMetadata && in_that);
2914 
2915 
2918  unsigned int GetValue() const;
2919 
2922  HPS::UTF8 GetValueAsString() const;
2923 
2926  void SetValue(unsigned int in_value);
2927 };
2928 
2929 
2931 class SPRK_API BooleanMetadata : public Metadata
2932 {
2933 public:
2935  BooleanMetadata();
2936 
2940  BooleanMetadata(Metadata const & in_that);
2941 
2944  BooleanMetadata(BooleanMetadata const & in_that);
2945 
2948  BooleanMetadata(BooleanMetadata && in_that);
2949 
2953  BooleanMetadata(char const * in_name, bool in_value);
2954 
2955  virtual ~BooleanMetadata();
2956 
2957  HPS::Type ObjectType() const { return HPS::Type::BooleanMetadata; }
2958 
2959 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2960  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
2961 #endif
2962 
2966  BooleanMetadata & operator=(BooleanMetadata && in_that);
2967 
2968 
2971  bool GetValue() const;
2972 
2975  void SetValue(bool in_value);
2976 };
2977 
2978 
2979 
2981 class SPRK_API Factory : public Sprocket
2982 {
2983 public:
2984 
2987  static CanvasArray GetCanvases();
2988 
2991  static LayoutArray GetLayouts();
2992 
2995  static ViewArray GetViews();
2996 
2999  static ModelArray GetModels();
3000 
3003  static CADModelArray GetCADModels();
3004 
3010  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
3011 
3016  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
3017 
3023  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
3024 
3028  static Layout CreateLayout(char const * in_name = "");
3029 
3033  static View CreateView(char const * in_name = "");
3034 
3038  static Model CreateModel(char const * in_name = "");
3039 
3040  static Component CreateComponent(HPS::Component const & in_owner, char const * in_name = "");
3041 
3042 private:
3043  Factory() {}
3044 };
3045 
3055 class SPRK_API AxisTriadOperator : public Operator
3056 {
3057 public:
3058  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3060  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
3061 
3067  virtual bool OnMouseDown(MouseState const & in_state);
3072  virtual bool OnMouseUp(MouseState const & in_state);
3077  virtual bool OnMouseMove(MouseState const & in_state);
3078 
3083  virtual bool OnTouchDown(TouchState const & in_state);
3088  virtual bool OnTouchUp(TouchState const & in_state);
3093  virtual bool OnTouchMove(TouchState const & in_state);
3094 
3095  virtual void OnViewAttached();
3096 
3097 private:
3098 
3099  bool AxisOrbit(HPS::WindowPoint const & in_loc);
3100  void Transition(HPS::SelectionResults selection_results);
3101  void TranslatePoint(HPS::WindowPoint * point);
3102  bool IsEventRelevant(HPS::Point const & event_location);
3103 
3104  bool operator_active;
3105  HPS::WindowPoint start_point;
3106  HPS::Vector start_sphere_point;
3107  float axis_subwindow_width;
3108  float axis_subwindow_height;
3109  HPS::TouchID tracked_touch_ID;
3110  HPS::Rectangle axis_subwindow;
3111  HPS::IntRectangle axis_subwindow_offsets;
3112  HPS::SegmentKey axis_triad_segment;
3113 
3114 };
3115 
3118 {
3119 public:
3122  virtual ~SmoothTransitionCompleteEvent();
3123 
3126  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
3127  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
3128 
3131  SmoothTransitionCompleteEvent(Event const & in_event) : Event(in_event)
3132  {
3133  if (in_event.GetChannel() == Object::ClassID<SmoothTransitionCompleteEvent>())
3134  {
3135  auto that = static_cast<SmoothTransitionCompleteEvent const &>(in_event);
3136  view = that.view;
3137  }
3138  else
3139  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3140  }
3141 
3144  Event * Clone() const
3145  {
3147  return new_event;
3148  }
3149 
3153  virtual bool Drop(Event const * in_that_event) const
3154  {
3155  HPS_UNREFERENCED(in_that_event);
3156  return false;
3157  }
3158 
3159  HPS::View view;
3160 };
3161 
3171 class SPRK_API NavigationCubeOperator : public Operator
3172 {
3173 public:
3174  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3175  ~NavigationCubeOperator() { OnViewDetached(); }
3176 
3178  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3179 
3184  virtual bool OnMouseDown(MouseState const & in_state);
3189  virtual bool OnMouseUp(MouseState const & in_state);
3194  virtual bool OnMouseMove(MouseState const & in_state);
3195 
3199  virtual bool OnTouchDown(TouchState const & in_state);
3204  virtual bool OnTouchUp(TouchState const & in_state);
3209  virtual bool OnTouchMove(TouchState const & in_state);
3210 
3211  virtual void OnViewAttached();
3212  virtual void OnViewDetached();
3213 
3214  virtual void OnModelAttached();
3215 
3216  void UpdateHighlightColor();
3217 
3221  void SetReferenceSegment(HPS::SegmentKey const & in_segment);
3222 
3227  void SetReferenceSegment(HPS::SegmentKeyArray const & in_segments);
3228 
3232  HPS::SegmentKeyArray ShowReferenceSegment();
3233 
3234 private:
3235  void Transition(HPS::SelectionResults selection_results);
3236  bool Orbit(HPS::WindowPoint const & in_loc);
3237  void TranslatePoint(HPS::WindowPoint * point);
3238  bool IsEventRelevant(HPS::Point const & event_location);
3239  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3240 
3241  bool operator_active;
3242  HPS::TouchID tracked_touch_ID;
3243  HPS::WindowPoint start_point;
3244  HPS::WindowPoint down_position;
3245  HPS::Vector start_sphere_point;
3246  HPS::SegmentKeyArray reference_segments; //rotation and zooming happen around these segments
3247 
3248  HPS::SegmentKey nav_cube_segment;
3249  HPS::SegmentKey style_segment;
3250  HPS::PortfolioKey portfolio;
3251  HPS::ReferenceKeyArrayArray groups;
3252  HPS::HighlightOptionsKit highlight_options_kit;
3253  HPS::CameraKit previous_camera;
3254  int previous_face;
3255  bool suppress_mouse_over_highlights;
3256 
3257  HPS::Rectangle nav_cube_subwindow;
3258  HPS::IntRectangle nav_cube_subwindow_offsets;
3259  float nav_cube_subwindow_width;
3260  float nav_cube_subwindow_height;
3261 
3262  int highlighted_group;
3263 
3264  bool moving;
3265 
3266  class SmoothTransitionCompleteEventHandler : public EventHandler
3267  {
3268  public:
3269  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3270  : handler_view(in_view), handler_moving(&in_moving) {}
3271 
3272  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3273 
3274  virtual HandleResult Handle(HPS::Event const * in_event);
3275 
3276  private:
3277  View handler_view;
3278  bool * handler_moving;
3279  };
3280 
3281  SmoothTransitionCompleteEventHandler * handler;
3282 };
3283 
3284 
3285 
3286 
3287 class SceneTreeItem;
3288 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3289 class SceneTree;
3290 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3291 
3294 class SPRK_API SceneTree : public Sprocket
3295 {
3296 public:
3299  enum class ItemType : uint32_t
3300  {
3301  None = 0x00000000,
3302  GenericMask = 0xffff0000,
3303 
3304  Segment = 0x00000001,
3305  Include = 0x00000002,
3306  ConditionalExpression = 0x00000003,
3307  StaticModelSegment = 0x00000004,
3308  AttributeFilter = 0x00000005,
3309 
3310  Geometry = 0x00010000,
3311  CuttingSection = 0x00010001,
3312  Shell = 0x00010002,
3313  Mesh = 0x00010003,
3314  Grid = 0x00010004,
3315  NURBSSurface = 0x00010005,
3316  Cylinder = 0x00010006,
3317  Sphere = 0x00010007,
3318  Polygon = 0x00010008,
3319  Circle = 0x00010009,
3320  CircularWedge = 0x0001000a,
3321  Ellipse = 0x0001000b,
3322  Line = 0x0001000c,
3323  NURBSCurve = 0x0001000d,
3324  CircularArc = 0x0001000e,
3325  EllipticalArc = 0x0001000f,
3326  InfiniteLine = 0x00010010,
3327  InfiniteRay = 0x00010011,
3328  Marker = 0x00010012,
3329  Text = 0x00010013,
3330  Reference = 0x00010014,
3331  DistantLight = 0x00010015,
3332  Spotlight = 0x00010016,
3333 
3334  Attribute = 0x00020000,
3335  Portfolio = 0x00020001,
3336  SegmentStyle = 0x00020002,
3337  NamedStyle = 0x00020003,
3338  MaterialPalette = 0x00020004,
3339  Priority = 0x00020005,
3340  Material = 0x00020006,
3341  Camera = 0x00020007,
3342  ModellingMatrix = 0x00020008,
3343  UserData = 0x00020009,
3344  TextureMatrix = 0x0002000a,
3345  Culling = 0x0002000b,
3346  CurveAttribute = 0x0002000c,
3347  CylinderAttribute = 0x0002000d,
3348  EdgeAttribute = 0x0002000e,
3349  LightingAttribute = 0x0002000f,
3350  LineAttribute = 0x00020010,
3351  MarkerAttribute = 0x00020011,
3352  SurfaceAttribute = 0x00020012,
3353  Selectability = 0x00020013,
3354  SphereAttribute = 0x00020014,
3355  Subwindow = 0x00020015,
3356  TextAttribute = 0x00020016,
3357  Transparency = 0x00020017,
3358  Visibility = 0x00020018,
3359  VisualEffects = 0x00020019,
3360  Performance = 0x00020020,
3361  DrawingAttribute = 0x00020021,
3362  HiddenLineAttribute = 0x00020022,
3363  ContourLine = 0x00020023,
3364  Condition = 0x00020024,
3365  Bounding = 0x00020025,
3366  AttributeLock = 0x00020026,
3367  TransformMask = 0x00020027,
3368  ColorInterpolation = 0x00020028,
3369  CuttingSectionAttribute = 0x00020029,
3370 
3371  // window only attributes
3372  Debugging = 0x00020030,
3373  PostProcessEffects = 0x00020031,
3374  SelectionOptions = 0x00020032,
3375  UpdateOptions = 0x00020033,
3376 
3377  Definition = 0x00040000,
3378  NamedStyleDefinition = 0x00040001,
3379  TextureDefinition = 0x00040002,
3380  LinePatternDefinition = 0x00040003,
3381  GlyphDefinition = 0x00040004,
3382  CubeMapDefinition = 0x00040005,
3383  ImageDefinition = 0x00040006,
3384  MaterialPaletteDefinition = 0x00040007,
3385  ShaderDefinition = 0x00040008,
3386  ShapeDefinition = 0x00040009,
3387 
3388  Group = 0x00080000,
3389  SegmentGroup = 0x00080100,
3390  GeometryGroup = 0x00080200,
3391  AttributeGroup = 0x00080300,
3392  PortfolioGroup = 0x00080400,
3393  StyleGroup = 0x00080500,
3394  IncludeGroup = 0x00080600,
3395  DefinitionGroup = 0x00180000,
3396  NamedStyleDefinitionGroup = 0x00180700,
3397  TextureDefinitionGroup = 0x00180800,
3398  LinePatternDefinitionGroup = 0x00180900,
3399  GlyphDefinitionGroup = 0x00180a00,
3400  CubeMapDefinitionGroup = 0x00180b00,
3401  ImageDefinitionGroup = 0x00180c00,
3402  MaterialPaletteDefinitionGroup = 0x00180d00,
3403  ShaderDefinitionGroup = 0x00180e00,
3404  ShapeDefinitionGroup = 0x00180f00,
3405  CuttingSectionGroup = 0x00080001,
3406  ShellGroup = 0x00080002,
3407  MeshGroup = 0x00080003,
3408  GridGroup = 0x00080004,
3409  NURBSSurfaceGroup = 0x00080005,
3410  CylinderGroup = 0x00080006,
3411  SphereGroup = 0x00080007,
3412  PolygonGroup = 0x00080008,
3413  CircleGroup = 0x00080009,
3414  CircularWedgeGroup = 0x0008000a,
3415  EllipseGroup = 0x0008000b,
3416  LineGroup = 0x0008000c,
3417  NURBSCurveGroup = 0x0008000d,
3418  CircularArcGroup = 0x0008000e,
3419  EllipticalArcGroup = 0x0008000f,
3420  InfiniteLineGroup = 0x00080010,
3421  InfiniteRayGroup = 0x00080011,
3422  MarkerGroup = 0x00080012,
3423  TextGroup = 0x00080013,
3424  ReferenceGroup = 0x00080014,
3425  DistantLightGroup = 0x00080015,
3426  SpotlightGroup = 0x00080016,
3427  };
3428 
3430  SceneTree();
3431 
3434  SceneTree(Canvas const & in_canvas);
3435 
3438  SceneTree(SceneTree const & in_that);
3439 
3442  SceneTree(SceneTree && in_that);
3443 
3444  virtual ~SceneTree();
3445 
3446  virtual HPS::Type ObjectType() const { return HPS::Type::SceneTree; }
3447 
3451  SceneTree & operator=(SceneTree const & in_that);
3452 
3456  SceneTree & operator=(SceneTree && in_that);
3457 
3461  virtual void Assign(SceneTree const & in_that);
3462 
3466  bool Equals(SceneTree const & in_that) const;
3467 
3471  bool operator!=(SceneTree const & in_that) const;
3472 
3476  bool operator==(SceneTree const & in_that) const;
3477 
3478 
3487  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3488 
3498  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3499 
3510  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3511 
3519  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3520 
3523  HighlightOptionsKitArray GetHighlightOptions() const;
3524 
3525 
3530  void SetGroupingLimit(size_t in_limit);
3531 
3534  size_t GetGroupingLimit() const;
3535 
3536 
3543  void SetRoot(SceneTreeItemPtr const & in_root);
3544 
3547  SceneTreeItemPtr GetRoot() const;
3548 
3549 
3552  virtual void Flush();
3553 
3558  void SetHighlightEventHandling(bool in_state);
3559 
3563  bool GetHighlightEventHandling() const;
3564 
3567  void ReExpand();
3568 };
3569 
3570 
3573 class SPRK_API SceneTreeItem : public Sprocket
3574 {
3575 public:
3577  SceneTreeItem();
3578 
3581  SceneTreeItem(SceneTreeItem const & in_that);
3582 
3585  SceneTreeItem(SceneTreeItem && in_that);
3586 
3592  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3593 
3599  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3600 
3606  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3607 
3613  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3614 
3622  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3623 
3624  virtual ~SceneTreeItem();
3625 
3626  HPS::Type ObjectType() const { return HPS::Type::SceneTreeItem; }
3627 
3631  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3632 
3636  SceneTreeItem & operator=(SceneTreeItem && in_that);
3637 
3641  virtual void Assign(SceneTreeItem const & in_that);
3642 
3646  bool Equals(SceneTreeItem const & in_that) const;
3647 
3651  bool operator!=(SceneTreeItem const & in_that) const;
3652 
3656  bool operator==(SceneTreeItem const & in_that) const;
3657 
3658 
3661  SceneTreePtr GetTree() const;
3662 
3665  UTF8 GetTitle() const;
3666 
3669  SceneTree::ItemType GetItemType() const;
3670 
3674  bool HasItemType(SceneTree::ItemType in_mask) const;
3675 
3678  Key GetKey() const;
3679 
3682  KeyPath GetKeyPath() const;
3683 
3686  bool HasChildren() const;
3687 
3688 
3697  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3698 
3699 
3702  virtual void Expand();
3703 
3706  virtual void Collapse();
3707 
3708 
3713  bool IsSelected() const;
3714 
3720  virtual void Select();
3721 
3727  virtual void Unselect();
3728 
3733  bool IsHighlightable() const;
3734 
3740  bool IsHighlighted() const;
3741 
3746  void Highlight(size_t in_highlight_options_index = 0);
3747 
3753  void Highlight(HighlightOptionsKit const & in_highlight_options);
3754 
3760  void Unhighlight(size_t in_highlight_options_index = 0);
3761 
3768  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3769 
3772  bool IsExpanded() const;
3773 
3776  void ReExpand();
3777 };
3778 
3779 
3780 
3781 class ComponentTreeItem;
3782 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3783 class ComponentTree;
3784 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3785 
3788 class SPRK_API ComponentTree : public Sprocket
3789 {
3790 public:
3793  enum class ItemType
3794  {
3795  None,
3796  ExchangeComponent,
3797  ExchangeModelFile,
3798 
3799  ExchangeViewGroup,
3800  ExchangeAnnotationViewGroup,
3801  ExchangePMIGroup,
3802  ExchangeModelGroup,
3803 
3804  ParasolidComponent,
3805  ParasolidModelFile,
3806 
3807  DWGComponent,
3808  DWGModelFile,
3809  };
3810 
3812  ComponentTree();
3813 
3817  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3818 
3821  ComponentTree(ComponentTree const & in_that);
3822 
3825  ComponentTree(ComponentTree && in_that);
3826 
3827  virtual ~ComponentTree();
3828 
3829  virtual HPS::Type ObjectType() const { return HPS::Type::ComponentTree; }
3830 
3834  ComponentTree & operator=(ComponentTree const & in_that);
3835 
3839  ComponentTree & operator=(ComponentTree && in_that);
3840 
3844  virtual void Assign(ComponentTree const & in_that);
3845 
3849  bool Equals(ComponentTree const & in_that) const;
3850 
3854  bool operator!=(ComponentTree const & in_that) const;
3855 
3859  bool operator==(ComponentTree const & in_that) const;
3860 
3861 
3870  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3871 
3881  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3882 
3893  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3894 
3904  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3905 
3908  HighlightOptionsKitArray GetHighlightOptions() const;
3909 
3910 
3917  void SetRoot(ComponentTreeItemPtr const & in_root);
3918 
3921  ComponentTreeItemPtr GetRoot() const;
3922 
3923 
3926  virtual void Flush();
3927 
3930  void ReExpand();
3931 
3936  void SetHighlightEventHandling(bool in_state);
3937 
3941  bool GetHighlightEventHandling() const;
3942 };
3943 
3944 
3947 class SPRK_API ComponentTreeItem : public Sprocket
3948 {
3949 public:
3952 
3955  ComponentTreeItem(ComponentTreeItem const & in_that);
3956 
3960 
3966  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
3967 
3974  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
3975 
3976  virtual ~ComponentTreeItem();
3977 
3978  HPS::Type ObjectType() const { return HPS::Type::ComponentTreeItem; }
3979 
3983  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
3984 
3988  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
3989 
3993  virtual void Assign(ComponentTreeItem const & in_that);
3994 
3998  bool Equals(ComponentTreeItem const & in_that) const;
3999 
4003  bool operator!=(ComponentTreeItem const & in_that) const;
4004 
4008  bool operator==(ComponentTreeItem const & in_that) const;
4009 
4010 
4011 
4014  ComponentTreePtr GetTree() const;
4015 
4018  UTF8 GetTitle() const;
4019 
4022  ComponentTree::ItemType GetItemType() const;
4023 
4026  Component GetComponent() const;
4027 
4030  bool HasChildren() const;
4031 
4034  ComponentPath GetPath() const;
4035 
4036 
4044  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
4045 
4046 
4049  virtual void Expand();
4050 
4053  virtual void Collapse();
4054 
4055 
4061  bool IsHighlighted() const;
4062 
4067  virtual void OnHighlight(HighlightOptionsKit const & in_options);
4068 
4073  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
4074 
4075 
4080  void Highlight(size_t in_highlight_options_index = 0);
4081 
4087  void Highlight(HighlightOptionsKit const & in_highlight_options);
4088 
4093  void Unhighlight(size_t in_highlight_options_index = 0);
4094 
4100  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
4101 
4102 
4112  bool IsHidden() const;
4113 
4117  virtual void OnHide();
4118 
4122  virtual void OnShow();
4123 
4127  void Hide();
4128 
4132  void Show();
4133 
4138  void Isolate();
4139 
4142  bool IsExpanded() const;
4143 
4146  void ReExpand();
4147 };
4148 
4149 
4150 
4151 
4152 }
4153 #endif
4154 
4155 
4156 
Definition: sprk.h:2878
HPS::Type ObjectType() const
Definition: sprk.h:2712
Definition: hps.h:3312
Definition: hps.h:6162
Definition: sprk.h:991
HPS::Type ObjectType() const
Definition: sprk.h:479
Event * Clone() const
Definition: sprk.h:744
Definition: sprk.h:3055
Definition: sprk.h:264
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2313
HPS::Type ObjectType() const
Definition: sprk.h:272
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1188
Definition: hps.h:40312
ComponentHighlightEvent()
Definition: sprk.h:2295
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1214
Definition: hps.h:474
CameraChangedEvent(Event const &in_event)
Definition: sprk.h:1010
HPS::Type ObjectType() const
Definition: sprk.h:210
HPS::Type ObjectType() const
Definition: sprk.h:1100
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1173
HPS::Type ObjectType() const
Definition: sprk.h:2364
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5642
Location
Definition: sprk.h:1439
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1217
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1178
ItemType
Definition: sprk.h:3793
Definition: hps.h:5682
virtual intptr_t Freshen() const
Definition: sprk.h:1033
CaptureActivationEvent()
Definition: sprk.h:2486
Definition: sprk.h:66
Definition: sprk.h:207
Definition: sprk.h:666
Definition: sprk.h:100
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1138
Definition: sprk.h:3947
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1148
Definition: sprk.h:2931
HPS::Type ObjectType() const
Definition: sprk.h:2553
Definition: hps.h:40099
Definition: hps.h:1313
Definition: hps.h:1031
HPS::Type ObjectType() const
Definition: sprk.h:2063
Definition: hps.h:1672
Definition: sprk.h:234
ModelDeletedEvent()
Definition: sprk.h:952
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:3126
Definition: sprk.h:3788
Definition: hps.h:44899
Definition: sprk.h:1051
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1163
Definition: hps.h:7671
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1209
virtual HPS::Type ObjectType() const
Definition: sprk.h:3446
Definition: hps.h:3463
Definition: hps.h:2027
Definition: sprk.h:903
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:788
Definition: sprk.h:754
Definition: hps.h:1381
Definition: hps.h:852
HPS::Type ObjectType() const
Definition: sprk.h:1613
Definition: hps.h:40217
virtual void OnModelDetached()
Definition: sprk.h:1202
SmoothTransitionCompleteEvent(Event const &in_event)
Definition: sprk.h:3131
Definition: hps.h:1719
Definition: hps.h:1510
Definition: hps.h:8844
Definition: hps.h:248
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1205
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1779
Event * Clone() const
Definition: sprk.h:894
CameraChangedEvent()
Definition: sprk.h:995
SprocketKit & operator=(SprocketKit &&in_that)
Definition: sprk.h:254
Definition: hps.h:44798
Definition: hps.h:39187
Definition: sprk.h:1435
Definition: sprk.h:948
Definition: sprk.h:551
HPS::Type ObjectType() const
Definition: sprk.h:107
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:830
virtual void OnViewDetached()
Definition: sprk.h:1194
Definition: hps.h:39233
HPS::Type ObjectType() const
Definition: sprk.h:3626
LayoutDeletedEvent()
Definition: sprk.h:758
Event * Clone() const
Definition: sprk.h:938
virtual void OnViewAttached()
Definition: sprk.h:1191
Definition: hps.h:38621
Definition: hps.h:41645
Definition: hps.h:1071
Definition: sprk.h:2622
LayoutDetachedEvent()
Definition: sprk.h:713
Definition: sprk.h:2734
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1153
Definition: hps.h:9619
Definition: hps.h:40260
Definition: hps.h:1469
SmoothTransitionCompleteEvent()
Definition: sprk.h:3121
Definition: hps.h:1401
HPS::Type ObjectType() const
Definition: sprk.h:558
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1133
FilterActivationEvent()
Definition: sprk.h:2398
Definition: hps.h:1420
virtual void OnModelAttached()
Definition: sprk.h:1198
Definition: hps.h:36488
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2412
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:922
HPS::Type ObjectType() const
Definition: sprk.h:1467
HPS::Type ObjectType() const
Definition: sprk.h:1828
Definition: hps.h:7044
Location
Definition: sprk.h:1585
HPS::Type ObjectType() const
Definition: sprk.h:237
Definition: hps.h:44290
Definition: sprk.h:2686
Definition: sprk.h:1581
Definition: hps.h:41822
HPS::Type ObjectType() const
Definition: sprk.h:1314
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:227
Definition: hps.h:43343
virtual UTF8 GetName() const
Definition: sprk.h:1123
Definition: hps.h:44686
Definition: sprk.h:709
Event * Clone() const
Definition: sprk.h:2429
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2500
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1158
HPS::Type ObjectType() const
Definition: sprk.h:2808
CanvasDeletedEvent()
Definition: sprk.h:670
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1143
HPS::Type ObjectType() const
Definition: sprk.h:2642
HPS::Type ObjectType() const
Definition: sprk.h:2760
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:222
Event * Clone() const
Definition: sprk.h:2516
Definition: hps.h:15141
ViewDeletedEvent()
Definition: sprk.h:864
intptr_t GetChannel() const
Definition: hps.h:6295
Definition: sprk.h:797
SprocketKit(SprocketKit &&in_that)
Definition: sprk.h:249
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:3153
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3060
Definition: sprk.h:1718
Definition: hps.h:42099
Definition: hps.h:43955
virtual bool OnTextInput(HPS::UTF8 const &in_text)
Definition: sprk.h:1183
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:879
Definition: hps.h:36072
Definition: sprk.h:2830
ViewDetachedEvent()
Definition: sprk.h:808
Definition: hps.h:6262
Definition: sprk.h:1292
Definition: hps.h:410
HPS::Type ObjectType() const
Definition: sprk.h:2856
Event * Clone() const
Definition: sprk.h:2330
Definition: sprk.h:472
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:685
Definition: sprk.h:3171
Definition: sprk.h:2032
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:1023
ComponentType
Definition: sprk.h:1723
Definition: hps.h:43269
Definition: hps.h:2046
Definition: sprk.h:2284
Event * Clone() const
Definition: sprk.h:700
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:728
HPS::Type ObjectType() const
Definition: sprk.h:3978
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1128
ItemType
Definition: sprk.h:3299
Definition: sprk.h:2343
Definition: sprk.h:2981
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3178
Definition: sprk.h:184
Definition: sprk.h:3117
Definition: hps.h:429
Event * Clone() const
Definition: sprk.h:982
Definition: sprk.h:2442
Definition: hps.h:2066
ModelDetachedEvent()
Definition: sprk.h:907
static MouseButtons ButtonLeft()
Definition: hps.h:44408
virtual HPS::Type ObjectType() const
Definition: sprk.h:3829
Definition: sprk.h:3294
Definition: sprk.h:2782
UpdateType
Definition: hps.h:182
Definition: hps.h:8962
HPS::Type ObjectType() const
Definition: sprk.h:1061
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1220
Definition: hps.h:7590
Definition: sprk.h:2387
Definition: hps.h:35688
Definition: hps.h:355
Event * Clone() const
Definition: sprk.h:3144
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:967
Event * Clone() const
Definition: sprk.h:848
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:773
Definition: hps.h:9176
Definition: hps.h:10688
Definition: sprk.h:1235
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1168
Definition: sprk.h:3573
Definition: sprk.h:2528
Definition: hps.h:40786
Mode
Definition: sprk.h:189
Definition: hps.h:515
Definition: sprk.h:1092
Definition: hps.h:1114
Definition: hps.h:40144
Definition: sprk.h:860
Definition: sprk.h:2482
Definition: hps.h:38684
HPS::Type ObjectType() const
Definition: sprk.h:2904
HPS::Type ObjectType() const
Definition: sprk.h:2463
HPS::Type ObjectType() const
Definition: sprk.h:2957
Definition: hps.h:7302
Event * Clone() const
Definition: sprk.h:1040