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 #include <unordered_map>
17 
18 #ifdef _MSC_VER
19 # pragma warning(disable: 4251) //Not an issue as long as debug and release libraries aren't mixed
20 #ifndef STATIC_APP
21 # ifdef SPRK
22 # define SPRK_API __declspec (dllexport)
23 # else
24 # define SPRK_API __declspec (dllimport)
25 # endif
26 #endif
27 #else
28 # include <stddef.h>
29 # if defined(LINUX_SYSTEM) && defined(SPRK)
30 # ifndef STATIC_APP
31 # define SPRK_API __attribute__ ((visibility ("default")))
32 # endif
33 # endif
34 #endif
35 
36 #ifndef SPRK_API
37 # define SPRK_API
38 #endif
39 namespace SPRKI
40 {
41  class X;
42 };
43 
44 namespace HPS
45 {
46 
47 class Factory;
48 class Canvas;
49 class Layout;
50 class View;
51 class Model;
52 class Operator;
53 class OperatorControl;
54 class NavigationCubeControl;
55 class AxisTriadControl;
56 class Component;
57 class ComponentPath;
58 class ComponentHighlightEvent;
59 class Filter;
60 class Capture;
61 class CADModel;
62 class Metadata;
63 
64 
65 
66 
67 class SPRK_API Sprocket : public HPS::Object
68 {
69 public:
70  Sprocket() {}
71 #if !defined(_MSC_VER) || _MSC_VER >= 1900
72  Sprocket(HPS::Sprocket const & in_that) = default;
73 #endif
74  Sprocket(Sprocket && in_that) : HPS::Object(std::move(in_that)) {}
75 
76  virtual ~Sprocket() {}
77 };
84 typedef std::shared_ptr<Operator> OperatorPtr;
85 
86 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
87 
88 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
89 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
90 typedef std::vector<View, Allocator<View> > ViewArray;
91 typedef std::vector<Model, Allocator<Model> > ModelArray;
92 
93 typedef std::vector<Component, Allocator<Component> > ComponentArray;
94 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
95 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
96 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
97 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
98 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
99 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
100 typedef std::vector<HighlightOptionsKit, Allocator<HighlightOptionsKit>> HighlightOptionsKitArray;
106 class SPRK_API Canvas : public Sprocket
107 {
108 public:
109  Canvas();
110  Canvas(Canvas const & that);
111  ~Canvas();
112 
113  static const HPS::Type staticType = HPS::Type::Canvas;
114  HPS::Type ObjectType() const { return staticType; }
115 
117  void Delete();
118 
119  Canvas & operator=(Canvas const & in_that);
120  void Assign(Canvas const & in_that);
121 
122  bool Equals(Canvas const & in_that) const;
123  bool operator!= (Canvas const & in_that) const;
124  bool operator== (Canvas const & in_that) const;
125 
127  UTF8 GetName() const;
128 
132  void AttachLayout(Layout const & in_layout);
133 
137  void AttachViewAsLayout(View const & in_view);
138 
140  void DetachLayout();
141 
143  Layout GetAttachedLayout() const;
144 
146  IncludeKey GetAttachedLayoutIncludeLink() const;
147 
149  View GetFrontView() const;
150 
151  WindowKey const GetWindowKey() const;
152 
155  WindowKey GetWindowKey();
156 
157  PortfolioKey const GetPortfolioKey() const;
158 
160  PortfolioKey GetPortfolioKey();
161 
163  void Update() const;
164 
167  UpdateNotifier UpdateWithNotifier() const;
168 
172  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
173 
178  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
179 
183  void SetFrameRate(float in_frame_rate=20);
184 
188  float GetFrameRate() const;
189 };
190 
191 class SPRK_API Rendering
192 {
193 public:
196  enum class Mode
197  {
198  Gouraud,
199  GouraudWithLines,
200  Flat,
201  FlatWithLines,
202  Phong,
203  PhongWithLines,
204  HiddenLine,
205  FastHiddenLine,
206  Wireframe,
207  Default = Phong
208  };
209 
210 private:
211  Rendering() {}
212 };
213 
214 class SPRK_API SprocketControl : public Sprocket
215 {
216 public:
217  static const HPS::Type staticType = HPS::Type::SprocketControl;
218  HPS::Type ObjectType() const {return staticType;}
219 
220 #if !defined(_MSC_VER) || _MSC_VER >= 1900
221  SprocketControl(HPS::SprocketControl const & in_that) = default;
222 #endif
223 
224 protected:
225  SprocketControl() {}
226 
230  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
231 
236  {
237  this->Object::operator=(std::move(in_that));
238  return *this;
239  }
240 };
241 
242 class SPRK_API SprocketKit : public Sprocket
243 {
244 public:
245  static const HPS::Type staticType = HPS::Type::SprocketKit;
246  HPS::Type ObjectType() const { return staticType; }
247 
248 #if !defined(_MSC_VER) || _MSC_VER >= 1900
249  SprocketKit(HPS::SprocketKit const & in_that) = default;
250 #endif
251 
252 protected:
253  SprocketKit() {}
254 
258  SprocketKit(SprocketKit && in_that) : Sprocket(std::move(in_that)) {}
259 
264  {
265  this->Object::operator=(std::move(in_that));
266  return *this;
267  }
268 };
269 
273 class SPRK_API View : public Sprocket
274 {
275 public:
276  View();
277  View(View const & that);
278  explicit View(SprocketControl const & in_ctrl);
279  ~View();
280 
281  static const HPS::Type staticType = HPS::Type::View;
282  HPS::Type ObjectType() const { return staticType; }
283 
285  void Delete();
286 
287  View & operator=(View const & in_that);
288  void Assign(View const & in_that);
289 
290  bool Equals(View const & in_that) const;
291  bool operator!= (View const & in_that) const;
292  bool operator== (View const & in_that) const;
293 
295  UTF8 GetName() const;
296 
297 
300  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
301 
305  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
306 
307 
311  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
312 
318  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
319 
320 
326  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
327 
328 
330  HPS::View & FitWorld();
331 
337  HPS::View & FitWorld(SegmentKey const & in_segment);
338 
339 
342  HPS::View & FitWorld(BoundingKit const & in_bounding);
343 
349  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
350 
351 
356  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
357 
362  void AttachModel(Model const & in_model);
363 
365  void DetachModel();
366 
368  Model GetAttachedModel() const;
369 
371  IncludeKey GetAttachedModelIncludeLink() const;
372 
376  void SetRenderingMode(Rendering::Mode in_mode);
377 
380  Rendering::Mode GetRenderingMode() const;
381 
383  OperatorPtrArray GetOperators() const;
384 
387  void SetOperators(OperatorPtrArray & in_operators);
388 
392  void SetOperators(size_t in_count, OperatorPtr in_operators []);
393 
396  void SetOperator(OperatorPtr const & in_operator);
397 
401  void SetOperator(Operator * in_operator);
402 
404  OperatorControl GetOperatorControl();
405  OperatorControl const GetOperatorControl() const;
406 
408  NavigationCubeControl GetNavigationCubeControl();
409  NavigationCubeControl const GetNavigationCubeControl() const;
410 
412  AxisTriadControl GetAxisTriadControl();
413  AxisTriadControl const GetAxisTriadControl() const;
414 
417  SegmentKey GetSegmentKey();
418  SegmentKey const GetSegmentKey() const;
419 
422  SegmentKey GetModelOverrideSegmentKey();
423  SegmentKey const GetModelOverrideSegmentKey() const;
424 
425 
426  PortfolioKey const GetPortfolioKey() const;
427 
429  PortfolioKey GetPortfolioKey();
430 
435  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
436 
438  bool GetSimpleShadow();
439 
444  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
445 
447  bool GetSimpleReflection();
448 
450  void Update() const;
451 
454  UpdateNotifier UpdateWithNotifier() const;
455 
459  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
460 
466  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
467 
471  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
472 
474  KeyArray const GetNavigationKeys();
475 
477  LayoutArray GetOwningLayouts();
478  LayoutArray const GetOwningLayouts() const;
479 };
480 
484 class SPRK_API Model : public Sprocket
485 {
486 public:
487  Model();
488  Model(Model const & that);
489  ~Model();
490 
491  static const HPS::Type staticType = HPS::Type::Model;
492  HPS::Type ObjectType() const { return staticType; }
493 
495  void Delete();
496 
497  Model & operator=(Model const & in_that);
498  void Assign(Model const & in_that);
499 
500  bool Equals(Model const & in_that) const;
501  bool operator!= (Model const & in_that) const;
502  bool operator== (Model const & in_that) const;
503 
505  UTF8 GetName() const;
506 
509  SegmentKey GetSegmentKey();
510  SegmentKey const GetSegmentKey() const;
511 
513  SegmentKey GetLibraryKey();
514  SegmentKey const GetLibraryKey() const;
515 
517  PortfolioKey GetPortfolioKey();
518  PortfolioKey const GetPortfolioKey() const;
519 
521  HPS::Vector GetUpVector();
522  HPS::Vector const GetUpVector() const;
523 
525  HPS::Vector GetFrontVector();
526  HPS::Vector const GetFrontVector() const;
527 
529  HPS::ViewArray GetOwningViews();
530  HPS::ViewArray const GetOwningViews() const;
531 
535  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
536 
538  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector) const;
539 
541  void Update() const;
542 
545  UpdateNotifier UpdateWithNotifier() const;
546 
550  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
551 
557  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
558 
559 };
560 
564 class SPRK_API Layout : public Sprocket
565 {
566 public:
567  Layout();
568  Layout(Layout const & that);
569  ~Layout();
570 
571  static const HPS::Type staticType = HPS::Type::Layout;
572  HPS::Type ObjectType() const { return staticType; }
573 
575  void Delete();
576 
577  Layout & operator=(Layout const & in_that);
578  void Assign(Layout const & in_that);
579 
580  bool Equals(Layout const & in_that) const;
581  bool operator!= (Layout const & in_that) const;
582  bool operator== (Layout const & in_that) const;
583 
585  UTF8 GetName() const;
586 
588  size_t GetLayerCount() const;
589 
593  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
597  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
598 
601  void DetachLayer(size_t in_layer);
602 
605  void DetachView(View const & in_view); // everywhere it occurs
606 
609  void BringToFront(size_t in_layer);
610 
614  void ReassignLayer(size_t in_layer, HPS::View in_view);
615 
619  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
620 
622  View GetFrontView() const;
623 
627  View GetAttachedView(size_t in_layer = 0) const;
628 
632  Rectangle GetPosition(size_t in_layer) const;
633 
635  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
636 
638  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
639 
643  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
644 
648  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
649 
652  SegmentKey GetSegmentKey();
653  SegmentKey const GetSegmentKey() const;
654 
656  CanvasArray GetOwningCanvases();
657  CanvasArray const GetOwningCanvases() const;
658 
660  void Update() const;
661 
664  UpdateNotifier UpdateWithNotifier() const;
665 
669  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
670 
676  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
677 
678 };
679 
680 class SPRK_API CanvasDeletedEvent : public Event
681 {
682 public:
685  {
686  channel = GetClassID();
687  consumable = false;
688  }
689 
690  CanvasDeletedEvent(Canvas const & in_canvas)
691  : Event(), canvas(in_canvas)
692  {
693  channel = GetClassID();
694  consumable = false;
695  }
696 
699  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
700  {
701  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
702  {
703  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
704  canvas = that.canvas;
705  }
706  else
707  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
708  }
709 
711 
714  Event * Clone() const
715  {
716  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
717  return new_event;
718  }
719 
720  Canvas canvas;
721 };
722 
723 class SPRK_API LayoutDetachedEvent : public Event
724 {
725 public:
728  {
729  channel = GetClassID();
730  consumable = false;
731  }
732 
733  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
734  : Event(), canvas(in_canvas), layout(in_layout)
735  {
736  channel = GetClassID();
737  consumable = false;
738  }
739 
742  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
743  {
744  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
745  {
746  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
747  canvas = that.canvas;
748  layout = that.layout;
749  }
750  else
751  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
752  }
753 
755 
758  Event * Clone() const
759  {
760  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
761  return new_event;
762  }
763 
764  Canvas canvas;
765  Layout layout;
766 };
767 
768 class SPRK_API LayoutDeletedEvent : public Event
769 {
770 public:
773  {
774  channel = GetClassID();
775  consumable = false;
776  }
777 
778  LayoutDeletedEvent(Layout const & in_layout)
779  : Event(), layout(in_layout)
780  {
781  channel = GetClassID();
782  consumable = false;
783  }
784 
787  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
788  {
789  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
790  {
791  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
792  layout = that.layout;
793  }
794  else
795  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
796  }
797 
799 
802  Event * Clone() const
803  {
804  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
805  return new_event;
806  }
807 
808  Layout layout;
809 };
810 
811 class SPRK_API ViewDetachedEvent : public Event
812 {
813 public:
814  enum class Action
815  {
816  None = 0,
817  SpecificLayer,
818  AllLayers,
819  };
820 
822  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
823  {
824  channel = GetClassID();
825  consumable = false;
826  }
827 
828  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
829  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
830  {
831  channel = GetClassID();
832  consumable = false;
833  }
834 
835  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
836  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
837  {
838  channel = GetClassID();
839  consumable = false;
840  }
841 
844  ViewDetachedEvent(Event const & in_event) : Event(in_event)
845  {
846  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
847  {
848  auto that = static_cast<ViewDetachedEvent const &>(in_event);
849  layout = that.layout;
850  action = that.action;
851  layer = that.layer;
852  view = that.view;
853  }
854  else
855  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
856  }
857 
859 
862  Event * Clone() const
863  {
864  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
865  return new_event;
866  }
867 
868  Layout layout;
869  Action action;
870  size_t layer;
871  View view;
872 };
873 
874 class SPRK_API ViewDeletedEvent : public Event
875 {
876 public:
879  {
880  channel = GetClassID();
881  consumable = false;
882  }
883 
884  ViewDeletedEvent(View const & in_view)
885  : Event(), view(in_view)
886  {
887  channel = GetClassID();
888  consumable = false;
889  }
890 
893  ViewDeletedEvent(Event const & in_event) : Event(in_event)
894  {
895  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
896  {
897  auto that = static_cast<ViewDeletedEvent const &>(in_event);
898  view = that.view;
899  }
900  else
901  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
902  }
903 
904  ~ViewDeletedEvent();
905 
908  Event * Clone() const
909  {
910  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
911  return new_event;
912  }
913 
914  View view;
915 };
916 
917 class SPRK_API ModelDetachedEvent : public Event
918 {
919 public:
922  {
923  channel = GetClassID();
924  consumable = false;
925  }
926 
927  ModelDetachedEvent(View const & in_view, Model const & in_model)
928  : Event(), view(in_view), model(in_model)
929  {
930  channel = GetClassID();
931  consumable = false;
932  }
933 
936  ModelDetachedEvent(Event const & in_event) : Event(in_event)
937  {
938  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
939  {
940  auto that = static_cast<ModelDetachedEvent const &>(in_event);
941  view = that.view;
942  model = that.model;
943  }
944  else
945  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
946  }
947 
949 
952  Event * Clone() const
953  {
954  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
955  return new_event;
956  }
957 
958  View view;
959  Model model;
960 };
961 
962 class SPRK_API ModelDeletedEvent : public Event
963 {
964 public:
967  {
968  channel = GetClassID();
969  consumable = false;
970  }
971 
972  ModelDeletedEvent(Model const & in_model)
973  : Event(), model(in_model)
974  {
975  channel = GetClassID();
976  consumable = false;
977  }
978 
981  ModelDeletedEvent(Event const & in_event) : Event(in_event)
982  {
983  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
984  {
985  auto that = static_cast<ModelDeletedEvent const &>(in_event);
986  model = that.model;
987  }
988  else
989  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
990  }
991 
993 
996  Event * Clone() const
997  {
998  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
999  return new_event;
1000  }
1001 
1002  Model model;
1003 };
1004 
1005 class SPRK_API CameraChangedEvent : public Event
1006 {
1007 public:
1010  {
1011  channel = GetClassID();
1012  consumable = false;
1013  }
1014 
1015  CameraChangedEvent(View const & in_view)
1016  : Event(), view(in_view)
1017  {
1018  channel = GetClassID();
1019  consumable = false;
1020  }
1021 
1024  CameraChangedEvent(Event const & in_event) : Event(in_event)
1025  {
1026  if (in_event.GetChannel() == Object::ClassID<CameraChangedEvent>())
1027  {
1028  auto that = static_cast<CameraChangedEvent const &>(in_event);
1029  view = that.view;
1030  }
1031  else
1032  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
1033  }
1034 
1035  ~CameraChangedEvent();
1036 
1037  virtual bool Drop(Event const * in_that_event) const
1038  {
1039  CameraChangedEvent const * that_event = static_cast<CameraChangedEvent const *>(in_that_event);
1040 
1041  if (view == that_event->view)
1042  return true;
1043 
1044  return false;
1045  }
1046 
1047  virtual intptr_t Freshen() const
1048  {
1049  return GetClassID();
1050  }
1051 
1054  Event * Clone() const
1055  {
1056  CameraChangedEvent * new_event = new CameraChangedEvent(*this);
1057  return new_event;
1058  }
1059 
1060  View view;
1061 };
1062 
1065 class SPRK_API SprocketPath : public Sprocket
1066 {
1067 public:
1068  SprocketPath();
1069  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
1070  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
1071  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
1072  SprocketPath(SprocketPath const & that);
1073  ~SprocketPath();
1074 
1075  static const HPS::Type staticType = HPS::Type::SprocketPath;
1076  HPS::Type ObjectType() const { return staticType; }
1077 
1078  SprocketPath & operator=(SprocketPath const & in_that);
1079  void Set(SprocketPath const & in_that);
1080 
1081  bool Equals(SprocketPath const & in_that) const;
1082  bool operator!= (SprocketPath const & in_that) const;
1083  bool operator== (SprocketPath const & in_that) const;
1084 
1086  Canvas GetCanvas() const;
1087 
1089  Layout GetLayout() const;
1090 
1092  View GetView() const;
1093 
1095  Model GetModel() const;
1096 
1101  KeyPath GetKeyPath() const;
1102 };
1103 
1104 
1107 class SPRK_API Operator : public Sprocket
1108 {
1109 public:
1110  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1111  Operator(Operator const & in_that);
1112 
1113  virtual ~Operator();
1114 
1115  static const HPS::Type staticType = HPS::Type::Operator;
1116  HPS::Type ObjectType() const { return staticType; }
1117 
1118  virtual Operator & operator= (Operator const & in_that);
1119 
1121  virtual void Assign(Operator const & in_that);
1122 
1124  virtual bool Equals(Operator const & in_that) const;
1125 
1127  virtual bool operator!= (Operator const & in_that) const;
1128 
1130  virtual bool operator== (Operator const & in_that) const;
1131 
1133  void DetachView();
1134 
1136  View GetAttachedView() const;
1137 
1139  virtual UTF8 GetName() const { return "Operator"; }
1140 
1144  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1145 
1149  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1150 
1154  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1155 
1159  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1160 
1164  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1165 
1169  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1170 
1174  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1175 
1179  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1180 
1184  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1185 
1189  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1190 
1194  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1195 
1199  virtual bool OnTextInput(HPS::UTF8 const & in_text) { HPS_UNREFERENCED(in_text); return false; }
1200 
1204  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1205 
1208  virtual void OnViewAttached(HPS::View const & in_attached_view) { HPS_UNREFERENCED(in_attached_view); return; }
1209 
1212  virtual void OnViewDetached(HPS::View const & in_detached_view) { HPS_UNREFERENCED(in_detached_view); return; }
1213 
1216  virtual void OnModelAttached() { return; }
1217 
1220  virtual void OnModelDetached() { return; }
1221 
1223  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1224 
1227  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1228 
1232  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1233 
1235  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1236 
1238  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1239 
1240  enum class Priority
1241  {
1242  Low,
1243  Default,
1244  High
1245  };
1246 
1247 protected:
1248 
1249  HPS::MouseButtons mouse_trigger;
1250  HPS::ModifierKeys modifier_trigger;
1251 };
1252 
1253 class SPRK_API OperatorUtility
1254 {
1255  static double internal_acos(double x)
1256  {
1257  return (((x)<-1) ? (HPS::PI) : (((x)>1) ? (0) : (acos(x))));
1258  }
1259 
1260 public:
1261 
1262  enum ProjectedPlane
1263  {
1264  Plane_XY,
1265  Plane_YZ,
1266  Plane_XZ
1267  };
1268 
1269  static void ScreenToSphereMousePoint(HPS::Point const &in_pt, HPS::Vector &out_vec)
1270  {
1271  out_vec = HPS::Vector(in_pt);
1272  float len = static_cast<float>(out_vec.Length());
1273  if (len > 1.0f)
1274  {
1275  out_vec /= len;
1276  out_vec.z = 0;
1277  }
1278  else
1279  out_vec.z = (float)sqrt(1.0f - (len*len));
1280  }
1281 
1282  static float CalculateAngleOrbitOnPlane(HPS::Vector const &axis, ProjectedPlane plane)
1283  {
1284  float theta;
1285 
1286  HPS::Vector vtmp;
1287  if (plane == Plane_XY)
1288  vtmp = HPS::Vector(axis.x, axis.y, 0);
1289  else if (plane == Plane_YZ)
1290  vtmp = HPS::Vector(0, axis.y, axis.z);
1291  else
1292  vtmp = HPS::Vector(axis.x, 0, axis.z);
1293  Vector naxis = axis;
1294 
1295  naxis.Normalize();
1296  vtmp.Normalize();
1297 
1298  float tmp = naxis.Dot(vtmp);
1299  if (static_cast<float>(Abs(tmp)) > 1.001f || static_cast<float>(Abs(tmp)) < 0.999f)
1300  theta = static_cast<float>(internal_acos(tmp));
1301  else
1302  theta = 0.0f;
1303 
1304  return theta;
1305  }
1306 };
1307 
1310 class SPRK_API OperatorControl : public SprocketControl
1311 {
1312 public:
1314  explicit OperatorControl(View const & in_view);
1315 
1317  OperatorControl(OperatorControl const & in_that);
1318 
1322  OperatorControl(OperatorControl && in_that);
1323 
1327  OperatorControl & operator=(OperatorControl && in_that);
1328 
1330  ~OperatorControl();
1331 
1332  static const HPS::Type staticType = HPS::Type::OperatorControl;
1333  HPS::Type ObjectType() const {return staticType;};
1334 
1336  OperatorControl & operator=(OperatorControl const & in_that);
1337 
1338 
1340  size_t GetCount();
1341 
1344  size_t GetCount(Operator::Priority in_priority);
1345 
1346 
1352  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1353 
1360  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1361 
1365  bool Pop(Operator::Priority in_priority = Operator::Priority::Default);
1366 
1371  bool Pop(OperatorPtr & out_operator);
1372 
1378  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1379 
1380 
1386  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1387 
1394  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1395 
1401  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Default);
1402 
1409  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Default);
1410 
1411 
1415  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Default);
1416 
1420  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1421 
1424  OperatorControl & UnsetEverything();
1425 
1426 
1430  bool ShowTop(OperatorPtr & out_operator) const;
1431 
1436  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1437 
1441  bool Show(OperatorPtrArray & out_operators) const;
1442 
1447  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1448 
1449 private:
1451  OperatorControl() {}
1452 };
1453 
1460 {
1461 public:
1462 
1463  enum class Location
1464  {
1465  TopRight,
1466  TopLeft,
1467  BottomRight,
1468  BottomLeft,
1469  Custom,
1470  };
1471 
1473  explicit NavigationCubeControl(View const & in_view);
1474 
1477 
1482 
1486  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1487 
1490 
1491  static const HPS::Type staticType = HPS::Type::NavigationCubeControl;
1492  HPS::Type ObjectType() const {return staticType;};
1493 
1495  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1496 
1505  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1506 
1509  Location GetLocation() const;
1510 
1514  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1515 
1518  HPS::Rectangle GetPosition() const;
1519 
1523  NavigationCubeControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1524 
1527  HPS::IntRectangle GetPositionOffsets() const;
1528 
1533  NavigationCubeControl & SetVisibility(bool in_visibility);
1534 
1537  bool GetVisibility() const;
1538 
1542  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1543 
1546  bool GetTextVisibility() const;
1547 
1562  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1563 
1566  HPS::UTF8 GetMaterialPalette() const;
1567 
1575  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1576 
1577 
1580  bool GetInteractivity() const;
1581 
1586  NavigationCubeControl & SetSize(float in_size);
1587 
1590  float GetSize() const;
1591 
1592  /* Sets the text displayed on the navigation cube.
1593  * note that if you plan on using the navigation cube on a very large and pixel dense screen
1594  * (example: a large TV), if you wish to specify a custom text size, you should do so using
1595  * one of the window relative text sizes.
1596  * \param in_back_string The text to display on the back face of the navigation cube
1597  * \param in_top_string The text to display on the top face of the navigation cube
1598  * \param in_left_string The text to display on the left face of the navigation cube
1599  * \param in_front_string The text to display on the front face of the navigation cube
1600  * \param in_bottom_string The text to display on the bottom face of the navigation cube
1601  * \param in_right_string The text to display on the right face of the navigation cube
1602  * \param in_text_attributes The attributes applied to the text on the navigation cube
1603  * \return A reference to this object. */
1604  NavigationCubeControl & SetText(const char * in_back_string, const char * in_top_string, const char * in_left_string,
1605  const char * in_front_string, const char * in_bottom_string, const char * in_right_string,
1606  HPS::TextAttributeKit const & in_text_attributes);
1607 
1608  /* Gets the text displayed on the navigation cube.
1609  * \param out_back_string The text displayed on the back face of the navigation cube
1610  * \param out_top_string The text displayed on the top face of the navigation cube
1611  * \param out_left_string The text displayed on the left face of the navigation cube
1612  * \param out_front_string The text displayed on the front face of the navigation cube
1613  * \param out_bottom_string The text displayed on the bottom face of the navigation cube
1614  * \param out_right_string The text displayed on the right face of the navigation cube
1615  * \param out_text_attributes The attributes applied to the text on the navigation cube
1616  * \return <span class='code'>true</span> if the navigation cube text was retrieved successfully, <span class='code'>false</span> otherwise. */
1617  bool GetText(UTF8 & out_back_string, UTF8 & out_top_string, UTF8 & out_left_string,
1618  UTF8 & out_front_string, UTF8 & out_bottom_string, UTF8 & out_right_string,
1619  HPS::TextAttributeKit & out_text_attributes) const;
1620 
1623  HPS::SegmentKey GetSegmentKey() const;
1624 
1625 private:
1628 
1630  HPS::SegmentKey GetNavigationCubeSegment() const;
1631  void SetNavigationCubeVisibilityLink(bool in_visibility) const;
1632 
1633  bool IsTextVisible() const;
1634 };
1635 
1638 class SPRK_API AxisTriadControl : public SprocketControl
1639 {
1640 public:
1641 
1642  enum class Location
1643  {
1644  TopRight,
1645  TopLeft,
1646  BottomRight,
1647  BottomLeft,
1648  Custom,
1649  };
1650 
1652  explicit AxisTriadControl(View const & in_view);
1653 
1655  AxisTriadControl(AxisTriadControl const & in_that);
1656 
1660  AxisTriadControl(AxisTriadControl && in_that);
1661 
1665  AxisTriadControl & operator=(AxisTriadControl && in_that);
1666 
1668  ~AxisTriadControl();
1669 
1670  static const HPS::Type staticType = HPS::Type::AxisTriadControl;
1671  HPS::Type ObjectType() const {return staticType;};
1672 
1674  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1675 
1684  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_position = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1685 
1688  Location GetLocation() const;
1689 
1693  AxisTriadControl & SetPosition(HPS::Rectangle const & in_position);
1694 
1697  HPS::Rectangle GetPosition() const;
1698 
1702  AxisTriadControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1703 
1706  HPS::IntRectangle GetPositionOffsets() const;
1707 
1712  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1713 
1716  bool GetVisibility() const;
1717 
1721  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1722 
1725  bool GetTextVisibility() const;
1726 
1735  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1736 
1739  HPS::UTF8 GetMaterialPalette() const;
1740 
1747  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1748 
1751  bool GetInteractivity() const;
1752 
1757  AxisTriadControl & SetSize(float in_size);
1758 
1761  float GetSize() const;
1762 
1765  HPS::SegmentKey GetSegmentKey() const;
1766 
1767 private:
1769  AxisTriadControl(){};
1770 
1772  HPS::SegmentKey GetAxisTriadSegment() const;
1773 
1774  void SetAxisVisibilityLink(bool in_visibility) const;
1775 };
1776 
1778 class SPRK_API Component : public Sprocket
1779 {
1780 public:
1781 
1784  enum class ComponentType : uint32_t
1785  {
1786  None = 0x00000000,
1787  GenericMask = 0xfffff000,
1788 
1789  ExchangeComponentMask = 0x00001000,
1790  ExchangeModelFile = 0x00001001,
1791  ExchangeProductOccurrence = 0x00001002,
1792  ExchangePartDefinition = 0x00001003,
1793 
1794  ExchangeView = 0x00001004,
1795  ExchangeFilter = 0x00001005,
1796 
1797  ExchangeRepresentationItemMask = 0x00003000,
1798  ExchangeRIBRepModel = 0x00003001,
1799  ExchangeRICurve = 0x00003002,
1800  ExchangeRIDirection = 0x00003003,
1801  ExchangeRIPlane = 0x00003004,
1802  ExchangeRIPointSet = 0x00003005,
1803  ExchangeRIPolyBRepModel = 0x00003006,
1804  ExchangeRIPolyWire = 0x00003007,
1805  ExchangeRISet = 0x00003008,
1806  ExchangeRICoordinateSystem = 0x00003009,
1807 
1808  ExchangeTopologyMask = 0x00005000,
1809  ExchangeTopoBody = 0x00005001,
1810  ExchangeTopoConnex = 0x00005002,
1811  ExchangeTopoShell = 0x00005003,
1812  ExchangeTopoFace = 0x00005004,
1813  ExchangeTopoLoop = 0x00005005,
1814  ExchangeTopoCoEdge = 0x00005006,
1815  ExchangeTopoEdge = 0x00005007,
1816  ExchangeTopoVertex = 0x00005008,
1817  ExchangeTopoSingleWireBody = 0x00005009,
1818  ExchangeTopoWireEdge = 0x0000500a,
1819 
1820  ExchangeDrawingMask = 0x00009000,
1821  ExchangeDrawingModel = 0x00009001,
1822  ExchangeDrawingView = 0x00009002,
1823  ExchangeDrawingSheet = 0x00009003,
1824  ExchangeBasicDrawingBlock = 0x00009004,
1825  ExchangeOperatorDrawingBlock = 0x00009005,
1826 
1827  ExchangePMIMask = 0x00011000,
1828  ExchangePMI = ExchangePMIMask,
1829  ExchangePMIText = 0x00011100,
1830  ExchangePMIRichText = 0x00011200,
1831  ExchangePMIRoughness = 0x00011300,
1832  ExchangePMIGDT = 0x00011400,
1833  ExchangePMIDatum = 0x00011500,
1834  ExchangePMILineWelding = 0x00011600,
1835  ExchangePMISpotWelding = 0x00011700,
1836  ExchangePMIDimension = 0x00011800,
1837  ExchangePMIBalloon = 0x00011900,
1838  ExchangePMICoordinate = 0x00011a00,
1839  ExchangePMIFastener = 0x00011b00,
1840  ExchangePMILocator = 0x00011c00,
1841  ExchangePMIMeasurementPoint = 0x00011d00,
1842 
1843 
1844  ParasolidComponentMask = 0x00020000,
1845 
1846  ParasolidModelFile = 0x00020001,
1847  ParasolidAssembly = 0x00020002,
1848  ParasolidInstance = 0x00020003,
1849 
1850  ParasolidTopologyMask = 0x00060000,
1851  ParasolidTopoBody = 0x00060001,
1852  ParasolidTopoRegion = 0x00060002,
1853  ParasolidTopoShell = 0x00060003,
1854  ParasolidTopoFace = 0x00060004,
1855  ParasolidTopoLoop = 0x00060005,
1856  ParasolidTopoFin = 0x00060006,
1857  ParasolidTopoEdge = 0x00060007,
1858  ParasolidTopoVertex = 0x00060008,
1859 
1860 
1861  DWGComponentMask = 0x00100000,
1862  DWGModelFile = 0x00100001,
1863  DWGLayout = 0x00100002,
1864  DWGBlockTable = 0x00100003,
1865  DWGBlockTableRecord = 0x00100004,
1866  DWGEntity = 0x00100005,
1867  DWGLayerTable = 0x00100006,
1868  DWGLayer = 0x00100007,
1869 
1870 
1871  UserComponent = 0x01000000,
1872  };
1873 
1876  enum class DeleteMode
1877  {
1878  Standard, // subcomponents will be deleted if they don't have multiple owners, otherwise their reference count will be decremented
1879  Full, // subcomponents will always be deleted, even if they are shared
1880  StandardAndExchange // Subcomponent will deleted if they don't have multiple owners, otherwise their reference count will be decremented.
1881  // The Exchange Entity associated to the Component will be deleted.
1882  };
1883 
1885  Component();
1886 
1889  Component(Component const & in_that);
1890 
1893  Component(Component && in_that);
1894 
1896  virtual ~Component();
1897 
1898  static const HPS::Type staticType = HPS::Type::Component;
1899  HPS::Type ObjectType() const { return staticType; }
1900 
1901 
1905  Component & operator=(Component const & in_that);
1906 
1910  Component & operator=(Component && in_that);
1911 
1915  virtual void Assign(Component const & in_that);
1916 
1920  bool Equals(Component const & in_that) const;
1921 
1925  bool operator!=(Component const & in_that) const;
1926 
1930  bool operator==(Component const & in_that) const;
1931 
1932 
1935  ComponentType GetComponentType() const;
1936 
1940  bool HasComponentType(ComponentType in_mask) const;
1941 
1942 
1943 
1949  void AddKey(Key const & in_key);
1950 
1953  KeyArray GetKeys() const;
1954 
1955 
1956 
1961  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1962 
1967  ComponentArray GetOwners() const;
1968 
1971  ComponentArray GetSubcomponents() const;
1972 
1977  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1978 
1979 
1980 
1983  void AddReference(Component & in_reference);
1984 
1991  ComponentArray GetReferrers() const;
1992 
1996  ComponentArray GetReferences() const;
1997 
1998 
1999 
2002  MetadataArray GetAllMetadata() const;
2003 
2007  Metadata GetMetadata(char const * in_name) const;
2008 
2012  UTF8 GetName() const;
2013 
2014 
2015 
2066  void Delete(HPS::Component::DeleteMode mode = HPS::Component::DeleteMode::Standard);
2067 
2071  void Flush();
2072 
2073 
2081  static KeyPathArray GetKeyPath(Component const & in_component);
2082 
2092  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
2093 
2102  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
2103 
2109  bool SetTransform(MatrixKit const & in_transform);
2110 
2116  bool AddTransform(MatrixKit const & in_transform);
2117 
2138  Component CopyTo(HPS::Component const & in_new_owner);
2139 
2144  bool SetName(char const * in_new_name);
2145 };
2146 
2148 class SPRK_API ComponentPath : public Sprocket
2149 {
2150 public:
2153  enum class PathType : uint32_t
2154  {
2155  Complete,
2156  Unique,
2157  };
2158 
2160  ComponentPath();
2161 
2164  ComponentPath(ComponentArray const & in_components);
2165 
2169  ComponentPath(size_t in_count, Component const in_components[]);
2170 
2172  ComponentPath(ComponentPath const & in_that);
2173 
2177  ComponentPath(ComponentPath && in_that);
2178 
2182  ComponentPath & operator=(ComponentPath && in_that);
2183 
2185  virtual ~ComponentPath();
2186 
2187  static const HPS::Type staticType = HPS::Type::ComponentPath;
2188  HPS::Type ObjectType() const { return staticType; }
2189 
2192  bool Empty() const;
2193 
2197  ComponentPath & operator+=(Component const & in_component);
2198 
2202  ComponentPath & operator+=(ComponentPath const & in_path);
2203 
2207  ComponentPath & operator+=(ComponentArray const & in_components);
2208 
2213  ComponentPath & Append(Component const & in_component);
2214 
2219  ComponentPath & Append(ComponentPath const & in_path);
2220 
2225  ComponentPath & Append(ComponentArray const & in_components);
2226 
2230  ComponentPath & operator=(ComponentPath const & in_that);
2231 
2235  ComponentPath & operator=(ComponentArray const & in_path);
2236 
2239  void Set(ComponentPath const & in_that);
2240 
2244  bool Equals(ComponentPath const & in_that) const;
2245 
2249  bool operator!= (ComponentPath const & in_that) const;
2250 
2254  bool operator== (ComponentPath const & in_that) const;
2255 
2256 
2260  ComponentPath & SetComponents(ComponentArray const & in_components);
2261 
2266  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
2267 
2270  ComponentArray GetComponents() const;
2271 
2275  KeyPathArray GetKeyPaths() const;
2276 
2281  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
2282 
2283 
2290  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options, bool in_remove_existing = true) const;
2291 
2298  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options, bool in_remove_existing = true) const;
2299 
2303  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2304 
2309  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2310 
2311 
2323  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2324 
2336  void Show(Canvas const & in_canvas, size_t in_layer = 0);
2337 
2349  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0) const;
2350 
2361  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
2362 
2374  static void Isolate(HPS::ComponentPathArray & in_component_paths, Canvas const & in_canvas, size_t in_layer = 0);
2375 
2385  void ResetVisibility(Canvas const & in_canvas, size_t in_layer = 0);
2386 
2397  static void ResetVisibility(HPS::ComponentPathArray & in_component_paths, Canvas const & in_canvas, size_t in_layer = 0);
2398 
2399  /* Returns the number of Components contained in this ComponentPath object.
2400  * \return the number of Components in this ComponentPath.*/
2401  size_t Size() const;
2402 
2403  /* Access a Component in this ComponentPath object. An HPS::IndexOutOfRangeException exception is thrown if in_index is out of range.
2404  * \param in_index The index of the Component to access, zero based.
2405  * \return The Component at position in_index in this ComponentPath.*/
2406  Component & At(size_t in_index);
2407 
2408  /* Access a Component in this ComponentPath object. An HPS::IndexOutOfRangeException exception is thrown if in_index is out of range.
2409  * \param in_index The index of the Component to access, zero based.
2410  * \return The Component at position in_index in this ComponentPath.*/
2411  Component const & At(size_t in_index) const;
2412 
2413  /* Inserts in_item in the ComponentPath before the element at position in_index, increasing the size of the ComponentPath by one.
2414  * An HPS::IndexOutOfRangeException exception is thrown if in_index is out of range.
2415  * \param in_index The index where in_item will be inserted
2416  * \param in_item The component to insert in this key path. */
2417  void Insert(size_t in_index, Component const & in_item);
2418 
2419  /* Traverses the components in this ComponentPath and removes the first one which matches in_item
2420  * NOTE: A useful ComponentPath should not contain duplicate components.
2421  * \param in_item The item to remove from the ComponentPath. */
2422  void Remove(Component const & in_item);
2423 
2424  /* Removes the the component at position in_index from this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if in_index is out of range.
2425  * \param in_index The index of the component to remove, zero based. */
2426  void Remove(size_t in_index);
2427 
2428  /* Creates and returns a new ComponentPath object, with the components organized in the reverse order.
2429  * \return A new ComponentPath object, containing components organized in the reverse order. */
2430  ComponentPath Reverse() const;
2431 
2432  /* Returns the first component of this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2433  * \return The first component of this ComponentPath.*/
2434  Component & Front();
2435 
2436  /* Returns the first component of this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2437  * \return The first component of this ComponentPath.*/
2438  Component const & Front() const;
2439 
2440  /* Returns the last component of this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2441  * \return The last component of this ComponentPath.*/
2442  Component & Back();
2443 
2444  /* Returns the last component of this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2445  * \return The last component of this ComponentPath.*/
2446  Component const & Back() const;
2447 
2448  /* Returns the first component of this ComponentPath and returns it. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2449  * \return The first component of this ComponentPath.*/
2450  Component PopFront();
2451 
2452  /* Returns the last component of this ComponentPath and returns it. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2453  * \return The last component of this ComponentPath.*/
2454  Component PopBack();
2455 
2456  /* Adds in_component to the front of the ComponentPath.
2457  * \param in_component The component to add to the front of the ComponentPath.
2458  * \return A reference to this object.*/
2459  ComponentPath & PushFront(Component const & in_component);
2460 
2461  /* Adds in_component to the end of the ComponentPath.
2462  * \param in_component The component to add to the end of the ComponentPath.
2463  * \return A reference to this object.*/
2464  ComponentPath & PushBack(Component const & in_component);
2465 
2469  ComponentPath & PushBack(ComponentPath const & in_path);
2470 
2474  ComponentPath & PushBack(ComponentArray const & in_components);
2475 
2476 #ifndef HPS_GULP_CLANG
2477  using iterator = HPS::ComponentArray::iterator;
2478  using const_iterator = HPS::ComponentArray::const_iterator;
2479  using reverse_iterator = HPS::ComponentArray::reverse_iterator;
2480  using const_reverse_iterator = HPS::ComponentArray::const_reverse_iterator;
2481 
2482  /* Returns an iterator pointing to the first Component contained in this ComponentPath
2483  * \return An iterator pointing to the first Component contained in this ComponentPath. */
2484  iterator begin();
2485 
2486  /* Returns an iterator pointing to the first Component contained in this ComponentPath
2487  * \return An iterator pointing to the first Component contained in this ComponentPath. */
2488  const_iterator begin() const;
2489 
2490  /* Returns a constant iterator pointing to the last Component contained in this ComponentPath
2491  * \return A constant iterator pointing to the last Component contained in this ComponentPath. */
2492  iterator end();
2493 
2494  /* Returns a constant iterator pointing to the last Component contained in this ComponentPath
2495  * \return A constant iterator pointing to the last Component contained in this ComponentPath. */
2496  const_iterator end() const;
2497 
2498  /* Returns a constant iterator pointing to the first Component contained in this ComponentPath
2499  * \return A constant iterator pointing to the first Component contained in this ComponentPath. */
2500  const_iterator cbegin() const;
2501 
2502  /* Returns a constant iterator pointing to the last Component contained in this ComponentPath
2503  * \return A constant iterator pointing to the last Component contained in this ComponentPath. */
2504  const_iterator cend() const;
2505 
2506  /* Returns a reverse iterator pointing to the last Component contained in this ComponentPath
2507  * \return A reverse iterator pointing to the last Component contained in this ComponentPath. */
2508  reverse_iterator rbegin();
2509 
2510  /* Returns a reverse iterator pointing to the first Component contained in this ComponentPath
2511  * \return A reverse iterator pointing to the first Component contained in this ComponentPath. */
2512  reverse_iterator rend();
2513 
2514  /* Returns a constant reverse iterator pointing to the last Component contained in this ComponentPath
2515  * \return A constant reverse iterator pointing to the last Component contained in this ComponentPath. */
2516  const_reverse_iterator rbegin() const;
2517 
2518  /* Returns a constant iterator pointing to the first Component contained in this ComponentPath
2519  * \return A constant iterator pointing to the first Component contained in this ComponentPath. */
2520  const_reverse_iterator rend() const;
2521 #endif
2522 };
2523 
2524 
2529 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2530 {
2531  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2532 }
2533 
2538 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2539 {
2540  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2541 }
2542 
2547 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2548 {
2549  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2550 }
2551 
2556 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2557 {
2558  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2559 }
2560 
2565 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2566 {
2567  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2568 }
2569 
2574 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2575 {
2576  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2577 }
2578 
2583 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2584 {
2585  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2586 }
2587 
2592 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2593 {
2594  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2595 }
2596 
2601 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2602 {
2603  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2604 }
2605 
2607 class SPRK_API ComponentResetEvent : public HPS::Event
2608 {
2609 public:
2610 
2612  {
2613  channel = GetClassID();
2614  consumable = false;
2615  }
2616 
2617  ComponentResetEvent(HPS::ComponentPath const & in_path, HPS::Canvas const & in_canvas, size_t in_layer = 0)
2618  : Event(), path(in_path), canvas(in_canvas), layer(in_layer)
2619  {
2620  channel = GetClassID();
2621  consumable = false;
2622  }
2623 
2624  ComponentResetEvent(HPS::Event const & in_event) : Event(in_event)
2625  {
2626  if (in_event.GetChannel() == HPS::Object::ClassID<ComponentResetEvent>())
2627  {
2628  auto that = static_cast<ComponentResetEvent const &>(in_event);
2629  path = that.path;
2630  canvas = that.canvas;
2631  layer = that.layer;
2632  }
2633  else
2634  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2635  }
2636 
2637  virtual ~ComponentResetEvent() {}
2638 
2639  Event * Clone() const override
2640  {
2641  ComponentResetEvent * new_event = new ComponentResetEvent(*this);
2642  return new_event;
2643  }
2644 
2645  HPS::ComponentPath path;
2646  HPS::Canvas canvas;
2647  size_t layer;
2648 };
2649 
2651 class SPRK_API ComponentShownEvent : public HPS::Event
2652 {
2653 public:
2654 
2656  {
2657  channel = GetClassID();
2658  consumable = false;
2659  }
2660 
2661  ComponentShownEvent(HPS::ComponentPath const & in_path, HPS::Canvas const & in_canvas, size_t in_layer = 0)
2662  : Event(), path(in_path), canvas(in_canvas), layer(in_layer)
2663  {
2664  channel = GetClassID();
2665  consumable = false;
2666  }
2667 
2668  ComponentShownEvent(HPS::Event const & in_event) : Event(in_event)
2669  {
2670  if (in_event.GetChannel() == HPS::Object::ClassID<ComponentShownEvent>())
2671  {
2672  auto that = static_cast<ComponentShownEvent const &>(in_event);
2673  path = that.path;
2674  canvas = that.canvas;
2675  layer = that.layer;
2676  }
2677  else
2678  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2679  }
2680 
2681  virtual ~ComponentShownEvent() {}
2682 
2683  Event * Clone() const override
2684  {
2685  ComponentShownEvent * new_event = new ComponentShownEvent(*this);
2686  return new_event;
2687  }
2688 
2689  HPS::ComponentPath path;
2690  HPS::Canvas canvas;
2691  size_t layer;
2692 };
2693 
2695 class SPRK_API ComponentHiddenEvent : public HPS::Event
2696 {
2697 public:
2698 
2700  {
2701  channel = GetClassID();
2702  consumable = false;
2703  }
2704 
2705  ComponentHiddenEvent(HPS::ComponentPath const & in_path, HPS::Canvas const & in_canvas, size_t in_layer = 0)
2706  : Event(), path(in_path), canvas(in_canvas), layer(in_layer)
2707  {
2708  channel = GetClassID();
2709  consumable = false;
2710  }
2711 
2712  ComponentHiddenEvent(HPS::Event const & in_event) : Event(in_event)
2713  {
2714  if (in_event.GetChannel() == HPS::Object::ClassID<ComponentHiddenEvent>())
2715  {
2716  auto that = static_cast<ComponentHiddenEvent const &>(in_event);
2717  path = that.path;
2718  canvas = that.canvas;
2719  layer = that.layer;
2720  }
2721  else
2722  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2723  }
2724 
2725  virtual ~ComponentHiddenEvent() {}
2726 
2727  Event * Clone() const override
2728  {
2729  ComponentHiddenEvent * new_event = new ComponentHiddenEvent(*this);
2730  return new_event;
2731  }
2732 
2733  HPS::ComponentPath path;
2734  HPS::Canvas canvas;
2735  size_t layer;
2736 };
2737 
2739 class SPRK_API ComponentIsolatedEvent : public Event
2740 {
2741 public:
2742 
2745  {
2746  channel = GetClassID();
2747  consumable = false;
2748  }
2749 
2750  ComponentIsolatedEvent(HPS::ComponentPath const & in_path, HPS::Canvas const & in_canvas, size_t in_layer = 0)
2751  : Event(), path(in_path), canvas(in_canvas), layer(in_layer)
2752  {
2753  channel = GetClassID();
2754  consumable = false;
2755  }
2756 
2759  ComponentIsolatedEvent(Event const & in_event) : Event(in_event)
2760  {
2761  if (in_event.GetChannel() == Object::ClassID<ComponentIsolatedEvent>())
2762  {
2763  auto that = static_cast<ComponentIsolatedEvent const &>(in_event);
2764  path = that.path;
2765  canvas = that.canvas;
2766  layer = that.layer;
2767  }
2768  else
2769  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2770  }
2771 
2772  virtual ~ComponentIsolatedEvent();
2773 
2776  Event * Clone() const override
2777  {
2778  ComponentIsolatedEvent * new_event = new ComponentIsolatedEvent(*this);
2779  return new_event;
2780  }
2781 
2782  ComponentPath path;
2783  HPS::Canvas canvas;
2784  size_t layer;
2785 };
2786 
2787 
2789 class SPRK_API ComponentHighlightEvent : public Event
2790 {
2791 public:
2792  enum class Action
2793  {
2794  None = 0,
2795  Highlight,
2796  Unhighlight,
2797  };
2798 
2801  {
2802  channel = GetClassID();
2803  consumable = false;
2804  action = Action::None;
2805  }
2806 
2807  ComponentHighlightEvent(Action in_action,
2808  HPS::Canvas const & in_canvas,
2809  size_t in_layer = 0,
2810  ComponentPath const & in_path = ComponentPath(),
2811  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2812  : Event(), action(in_action), path(in_path), options(in_options), canvas(in_canvas), layer(in_layer)
2813  {
2814  channel = GetClassID();
2815  consumable = false;
2816  }
2817 
2820  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2821  {
2822  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2823  {
2824  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2825  action = that.action;
2826  path = that.path;
2827  options = that.options;
2828  canvas = that.canvas;
2829  layer = that.layer;
2830  }
2831  else
2832  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2833  }
2834 
2835  virtual ~ComponentHighlightEvent();
2836 
2839  Event * Clone() const override
2840  {
2841  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2842  return new_event;
2843  }
2844 
2845  Action action;
2846  ComponentPath path;
2847  HighlightOptionsKit options;
2848  HPS::Canvas canvas;
2849  size_t layer;
2850 };
2851 
2852 
2854 class SPRK_API Filter : public Component
2855 {
2856 public:
2858  Filter();
2859 
2863  Filter(Component const & in_that);
2864 
2867  Filter(Filter const & in_that);
2868 
2871  Filter(Filter && in_that);
2872 
2873  virtual ~Filter();
2874 
2875  static const HPS::Type staticType = HPS::Type::Filter;
2876  HPS::Type ObjectType() const { return staticType; }
2877 
2878 
2879 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2880  Filter & operator=(Filter const & in_that) = default;
2881 #endif
2882 
2886  Filter & operator=(Filter && in_that);
2887 
2888 
2891  void Activate(View const & in_view);
2892 
2895  void Deactivate(View const & in_view);
2896 };
2897 
2898 
2899 class SPRK_API FilterActivationEvent : public Event
2900 {
2901 public:
2902  enum class Action
2903  {
2904  None = 0,
2905  Activate,
2906  Deactivate,
2907  };
2908 
2911  {
2912  channel = GetClassID();
2913  consumable = false;
2914  }
2915 
2916  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2917  {
2918  channel = GetClassID();
2919  consumable = false;
2920  }
2921 
2924  FilterActivationEvent(Event const & in_event) : Event(in_event)
2925  {
2926  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2927  {
2928  auto that = static_cast<FilterActivationEvent const &>(in_event);
2929  filter = that.filter;
2930  action = that.action;
2931  view = that.view;
2932  }
2933  else
2934  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2935  }
2936 
2938 
2941  Event * Clone() const
2942  {
2943  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2944  return new_event;
2945  }
2946 
2947  Filter filter;
2948  Action action;
2949  View view;
2950 };
2951 
2952 
2954 class SPRK_API Capture : public Component
2955 {
2956 public:
2958  Capture();
2959 
2963  Capture(Component const & in_that);
2964 
2967  Capture(Capture const & in_that);
2968 
2971  Capture(Capture && in_that);
2972 
2973  virtual ~Capture();
2974 
2975  static const HPS::Type staticType = HPS::Type::Capture;
2976  HPS::Type ObjectType() const { return staticType; }
2977 
2978 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2979  Capture & operator=(Capture const & in_that) = default;
2980 #endif
2981 
2985  Capture & operator=(Capture && in_that);
2986 
2987 
2991  View Activate();
2992 };
2993 
2994 
2995 class SPRK_API CaptureActivationEvent : public Event
2996 {
2997 public:
3000  {
3001  channel = GetClassID();
3002  consumable = false;
3003  }
3004 
3005  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
3006  {
3007  channel = GetClassID();
3008  consumable = false;
3009  }
3010 
3013  CaptureActivationEvent(Event const & in_event) : Event(in_event)
3014  {
3015  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
3016  {
3017  auto that = static_cast<CaptureActivationEvent const &>(in_event);
3018  capture = that.capture;
3019  view = that.view;
3020  }
3021  else
3022  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3023  }
3024 
3026 
3029  Event * Clone() const
3030  {
3031  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
3032  return new_event;
3033  }
3034 
3035  Capture capture;
3036  View view;
3037 };
3038 
3039 
3041 class SPRK_API CADModel : public Component
3042 {
3043 public:
3045  CADModel();
3046 
3050  CADModel(Component const & in_that);
3051 
3054  CADModel(CADModel const & in_that);
3055 
3058  CADModel(CADModel && in_that);
3059 
3062  CADModel(Model const & in_that);
3063 
3064  virtual ~CADModel();
3065 
3066  static const HPS::Type staticType = HPS::Type::CADModel;
3067  HPS::Type ObjectType() const { return staticType; }
3068 
3069 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3070  CADModel & operator=(CADModel const & in_that) = default;
3071 #endif
3072 
3076  CADModel & operator=(CADModel && in_that);
3077 
3078 
3082  Component GetComponentFromKey(Key const & in_key) const;
3083 
3095  ComponentPath GetComponentPath(KeyPath const & in_key_path, ComponentPath::PathType in_path_type = ComponentPath::PathType::Unique) const;
3096 
3108  ComponentPath GetComponentPath(SelectionItem const & in_item, ComponentPath::PathType in_path_type = ComponentPath::PathType::Unique) const;
3109 
3110 
3113  Model GetModel() const;
3114 
3117  FilterArray GetAllFilters() const;
3118 
3121  CaptureArray GetAllCaptures() const;
3122 
3126  FilterArray GetActiveFilters(View const & in_view) const;
3127 
3128 
3132  View ActivateDefaultCapture();
3133 
3134 
3142  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
3143 };
3144 
3145 
3146 
3149 class SPRK_API Metadata : public Sprocket
3150 {
3151 public:
3153  Metadata();
3154 
3157  Metadata(Metadata const & in_that);
3158 
3161  Metadata(Metadata && in_that);
3162 
3165  Metadata(char const * in_name);
3166 
3167  virtual ~Metadata();
3168 
3169  static const HPS::Type staticType = HPS::Type::Metadata;
3170  HPS::Type ObjectType() const { return staticType; }
3171 
3172 
3176  Metadata & operator=(Metadata const & in_that);
3177 
3181  Metadata & operator=(Metadata && in_that);
3182 
3186  virtual void Assign(Metadata const & in_that);
3187 
3191  bool Equals(Metadata const & in_that) const;
3192 
3196  bool operator!=(Metadata const & in_that) const;
3197 
3201  bool operator==(Metadata const & in_that) const;
3202 
3203 
3206  HPS::UTF8 GetName() const;
3207 
3210  void SetName(char const * in_name);
3211 };
3212 
3214 class SPRK_API IntegerMetadata : public Metadata
3215 {
3216 public:
3218  IntegerMetadata();
3219 
3223  IntegerMetadata(Metadata const & in_that);
3224 
3227  IntegerMetadata(IntegerMetadata const & in_that);
3228 
3231  IntegerMetadata(IntegerMetadata && in_that);
3232 
3236  IntegerMetadata(char const * in_name, int in_value);
3237 
3238  virtual ~IntegerMetadata();
3239 
3240  static const HPS::Type staticType = HPS::Type::IntegerMetadata;
3241  HPS::Type ObjectType() const { return staticType; }
3242 
3243 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3244  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
3245 #endif
3246 
3250  IntegerMetadata & operator=(IntegerMetadata && in_that);
3251 
3252 
3255  int GetValue() const;
3256 
3259  void SetValue(int in_value);
3260 };
3261 
3263 class SPRK_API UnsignedIntegerMetadata : public Metadata
3264 {
3265 public:
3268 
3272  UnsignedIntegerMetadata(Metadata const & in_that);
3273 
3277 
3281 
3285  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
3286 
3287  virtual ~UnsignedIntegerMetadata();
3288 
3289  static const HPS::Type staticType = HPS::Type::UnsignedIntegerMetadata;
3290  HPS::Type ObjectType() const { return staticType; }
3291 
3292 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3293  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
3294 #endif
3295 
3299  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
3300 
3301 
3304  unsigned int GetValue() const;
3305 
3308  void SetValue(unsigned int in_value);
3309 };
3310 
3312 class SPRK_API DoubleMetadata : public Metadata
3313 {
3314 public:
3316  DoubleMetadata();
3317 
3321  DoubleMetadata(Metadata const & in_that);
3322 
3325  DoubleMetadata(DoubleMetadata const & in_that);
3326 
3329  DoubleMetadata(DoubleMetadata && in_that);
3330 
3334  DoubleMetadata(char const * in_name, double in_value);
3335 
3336  virtual ~DoubleMetadata();
3337 
3338  static const HPS::Type staticType = HPS::Type::DoubleMetadata;
3339  HPS::Type ObjectType() const { return staticType; }
3340 
3341 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3342  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
3343 #endif
3344 
3348  DoubleMetadata & operator=(DoubleMetadata && in_that);
3349 
3350 
3353  double GetValue() const;
3354 
3357  void SetValue(double in_value);
3358 };
3359 
3361 class SPRK_API StringMetadata : public Metadata
3362 {
3363 public:
3365  StringMetadata();
3366 
3370  StringMetadata(Metadata const & in_that);
3371 
3374  StringMetadata(StringMetadata const & in_that);
3375 
3378  StringMetadata(StringMetadata && in_that);
3379 
3383  StringMetadata(char const * in_name, char const * in_value);
3384 
3385  virtual ~StringMetadata();
3386 
3387  static const HPS::Type staticType = HPS::Type::StringMetadata;
3388  HPS::Type ObjectType() const { return staticType; }
3389 
3390 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3391  StringMetadata & operator=(StringMetadata const & in_that) = default;
3392 #endif
3393 
3397  StringMetadata & operator=(StringMetadata && in_that);
3398 
3399 
3402  UTF8 GetValue() const;
3403 
3406  void SetValue(char const * in_value);
3407 };
3408 
3410 class SPRK_API TimeMetadata : public Metadata
3411 {
3412 public:
3414  TimeMetadata();
3415 
3419  TimeMetadata(Metadata const & in_that);
3420 
3423  TimeMetadata(TimeMetadata const & in_that);
3424 
3427  TimeMetadata(TimeMetadata && in_that);
3428 
3432  TimeMetadata(char const * in_name, unsigned int in_value);
3433 
3434  virtual ~TimeMetadata();
3435 
3436  static const HPS::Type staticType = HPS::Type::TimeMetadata;
3437  HPS::Type ObjectType() const { return staticType; }
3438 
3439 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3440  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
3441 #endif
3442 
3446  TimeMetadata & operator=(TimeMetadata && in_that);
3447 
3448 
3451  unsigned int GetValue() const;
3452 
3455  HPS::UTF8 GetValueAsString() const;
3456 
3459  void SetValue(unsigned int in_value);
3460 };
3461 
3462 
3464 class SPRK_API BooleanMetadata : public Metadata
3465 {
3466 public:
3468  BooleanMetadata();
3469 
3473  BooleanMetadata(Metadata const & in_that);
3474 
3477  BooleanMetadata(BooleanMetadata const & in_that);
3478 
3481  BooleanMetadata(BooleanMetadata && in_that);
3482 
3486  BooleanMetadata(char const * in_name, bool in_value);
3487 
3488  virtual ~BooleanMetadata();
3489 
3490  static const HPS::Type staticType = HPS::Type::BooleanMetadata;
3491  HPS::Type ObjectType() const { return staticType; }
3492 
3493 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3494  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
3495 #endif
3496 
3500  BooleanMetadata & operator=(BooleanMetadata && in_that);
3501 
3502 
3505  bool GetValue() const;
3506 
3509  void SetValue(bool in_value);
3510 };
3511 
3512 
3513 
3515 class SPRK_API Factory : public Sprocket
3516 {
3517 public:
3518 
3521  static CanvasArray GetCanvases();
3522 
3525  static LayoutArray GetLayouts();
3526 
3529  static ViewArray GetViews();
3530 
3533  static ModelArray GetModels();
3534 
3537  static CADModelArray GetCADModels();
3538 
3544  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
3545 
3546 #if TARGET_OS_ANDROID == 0 && !defined(__APPLE__)
3547 
3552  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
3553 #endif
3554 
3560  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
3561 
3565  static Layout CreateLayout(char const * in_name = "");
3566 
3570  static View CreateView(char const * in_name = "");
3571 
3575  static Model CreateModel(char const * in_name = "");
3576 
3581  static Component CreateComponent(Component const & in_owner, char const * in_name = "");
3582 
3588  static Component DeInstanceComponent(ComponentPath const & in_component_path);
3589 
3590 private:
3591  Factory() {}
3592 };
3593 
3603 class SPRK_API AxisTriadOperator : public Operator
3604 {
3605 public:
3606  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3608  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
3609 
3615  virtual bool OnMouseDown(MouseState const & in_state);
3620  virtual bool OnMouseUp(MouseState const & in_state);
3625  virtual bool OnMouseMove(MouseState const & in_state);
3626 
3631  virtual bool OnTouchDown(TouchState const & in_state);
3636  virtual bool OnTouchUp(TouchState const & in_state);
3641  virtual bool OnTouchMove(TouchState const & in_state);
3642 
3643  virtual void OnViewAttached(HPS::View const & in_attached_view);
3644 
3645 private:
3646 
3647  bool AxisOrbit(HPS::WindowPoint const & in_loc);
3648  void Transition(HPS::SelectionResults selection_results);
3649  void TranslatePoint(HPS::WindowPoint * point);
3650  bool IsEventRelevant(HPS::Point const & event_location);
3651 
3652  bool operator_active;
3653  HPS::WindowPoint start_point;
3654  HPS::Vector start_sphere_point;
3655  float axis_subwindow_width;
3656  float axis_subwindow_height;
3657  HPS::TouchID tracked_touch_ID;
3658  HPS::Rectangle axis_subwindow;
3659  HPS::IntRectangle axis_subwindow_offsets;
3660  HPS::SegmentKey axis_triad_segment;
3661 
3662 };
3663 
3666 {
3667 public:
3670  virtual ~SmoothTransitionCompleteEvent();
3671 
3674  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
3675  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
3676 
3679  SmoothTransitionCompleteEvent(Event const & in_event) : Event(in_event)
3680  {
3681  if (in_event.GetChannel() == Object::ClassID<SmoothTransitionCompleteEvent>())
3682  {
3683  auto that = static_cast<SmoothTransitionCompleteEvent const &>(in_event);
3684  view = that.view;
3685  }
3686  else
3687  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3688  }
3689 
3692  Event * Clone() const
3693  {
3695  return new_event;
3696  }
3697 
3701  virtual bool Drop(Event const * in_that_event) const
3702  {
3703  HPS_UNREFERENCED(in_that_event);
3704  return false;
3705  }
3706 
3707  HPS::View view;
3708 };
3709 
3728 class SPRK_API NavigationCubeOperator : public Operator
3729 {
3730 public:
3731  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3732  ~NavigationCubeOperator() { }
3733 
3735  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3736 
3741  virtual bool OnMouseDown(MouseState const & in_state);
3746  virtual bool OnMouseUp(MouseState const & in_state);
3751  virtual bool OnMouseMove(MouseState const & in_state);
3752 
3756  virtual bool OnTouchDown(TouchState const & in_state);
3761  virtual bool OnTouchUp(TouchState const & in_state);
3766  virtual bool OnTouchMove(TouchState const & in_state);
3767 
3768  virtual void OnViewAttached(HPS::View const & in_attached_view);
3769  virtual void OnViewDetached(HPS::View const & in_attached_view);
3770 
3771  virtual void OnModelAttached();
3772 
3777  void SetReferenceSegment(HPS::KeyPath const & in_path_to_segment);
3778 
3783  void SetReferenceSegment(HPS::KeyPathArray const & in_path_to_segments);
3784 
3788  HPS::KeyPathArray ShowReferenceSegment();
3789 
3794  void SetTransitionTime(HPS::Time const & in_time);
3795 
3798  HPS::Time GetTransitionTime() const;
3799 
3800 private:
3801  void Transition(HPS::SelectionResults const & selection_results);
3802  bool Orbit(HPS::WindowPoint const & in_loc);
3803  void TranslatePoint(HPS::WindowPoint * point);
3804  bool IsEventRelevant(HPS::Point const & event_location, HPS::KeyPath const & event_path);
3805  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3806 
3807 
3808  bool operator_active;
3809  HPS::TouchID tracked_touch_ID;
3810  HPS::WindowPoint start_point;
3811  HPS::WindowPoint down_position;
3812  HPS::Vector start_sphere_point;
3813  HPS::KeyPathArray reference_segments; //rotation and zooming happen around these segments
3814 
3815  HPS::SegmentKey nav_cube_segment;
3816  SegmentKeyArray style_segments; //in order: left / right / bottom / top / front / back
3817  UTF8Array named_styles; //in order: left / right / bottom / top / front / back
3818  HighlightOptionsKit highlight_options_kit;
3819  std::unordered_map<intptr_t, UTF8> key_to_style_map;
3820  HPS::PortfolioKey portfolio;
3821  HPS::ReferenceKeyArrayArray groups;
3822  HPS::CameraKit previous_camera;
3823  int previous_face;
3824  bool suppress_mouse_over_highlights;
3825 
3826  HPS::Rectangle nav_cube_subwindow;
3827  HPS::IntRectangle nav_cube_subwindow_offsets;
3828  float nav_cube_subwindow_width;
3829  float nav_cube_subwindow_height;
3830 
3831  int highlighted_group;
3832 
3833  bool moving;
3834  HPS::Time transition_time;
3835 
3836  class SmoothTransitionCompleteEventHandler : public EventHandler
3837  {
3838  public:
3839  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3840  : handler_view(in_view), handler_moving(&in_moving) {}
3841 
3842  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3843 
3844  virtual HandleResult Handle(HPS::Event const * in_event);
3845 
3846  private:
3847  View handler_view;
3848  bool * handler_moving;
3849  };
3850 
3851  SmoothTransitionCompleteEventHandler * handler;
3852 };
3853 
3854 
3855 
3856 
3857 class SceneTreeItem;
3858 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3859 class SceneTree;
3860 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3861 
3864 class SPRK_API SceneTree : public Sprocket
3865 {
3866 public:
3869  enum class ItemType : uint32_t
3870  {
3871  None = 0x00000000,
3872  GenericMask = 0xffff0000,
3873 
3874  Segment = 0x00000001,
3875  Include = 0x00000002,
3876  ConditionalExpression = 0x00000003,
3877  StaticModelSegment = 0x00000004,
3878  AttributeFilter = 0x00000005,
3879 
3880  Geometry = 0x00010000,
3881  CuttingSection = 0x00010001,
3882  Shell = 0x00010002,
3883  Mesh = 0x00010003,
3884  Grid = 0x00010004,
3885  NURBSSurface = 0x00010005,
3886  Cylinder = 0x00010006,
3887  Sphere = 0x00010007,
3888  Polygon = 0x00010008,
3889  Circle = 0x00010009,
3890  CircularWedge = 0x0001000a,
3891  Ellipse = 0x0001000b,
3892  Line = 0x0001000c,
3893  NURBSCurve = 0x0001000d,
3894  CircularArc = 0x0001000e,
3895  EllipticalArc = 0x0001000f,
3896  InfiniteLine = 0x00010010,
3897  InfiniteRay = 0x00010011,
3898  Marker = 0x00010012,
3899  Text = 0x00010013,
3900  Reference = 0x00010014,
3901  DistantLight = 0x00010015,
3902  Spotlight = 0x00010016,
3903 
3904  Attribute = 0x00020000,
3905  Portfolio = 0x00020001,
3906  SegmentStyle = 0x00020002,
3907  NamedStyle = 0x00020003,
3908  MaterialPalette = 0x00020004,
3909  Priority = 0x00020005,
3910  Material = 0x00020006,
3911  Camera = 0x00020007,
3912  ModellingMatrix = 0x00020008,
3913  UserData = 0x00020009,
3914  TextureMatrix = 0x0002000a,
3915  Culling = 0x0002000b,
3916  CurveAttribute = 0x0002000c,
3917  CylinderAttribute = 0x0002000d,
3918  EdgeAttribute = 0x0002000e,
3919  LightingAttribute = 0x0002000f,
3920  LineAttribute = 0x00020010,
3921  MarkerAttribute = 0x00020011,
3922  SurfaceAttribute = 0x00020012,
3923  Selectability = 0x00020013,
3924  SphereAttribute = 0x00020014,
3925  Subwindow = 0x00020015,
3926  TextAttribute = 0x00020016,
3927  Transparency = 0x00020017,
3928  Visibility = 0x00020018,
3929  VisualEffects = 0x00020019,
3930  Performance = 0x00020020,
3931  DrawingAttribute = 0x00020021,
3932  HiddenLineAttribute = 0x00020022,
3933  ContourLine = 0x00020023,
3934  Condition = 0x00020024,
3935  Bounding = 0x00020025,
3936  AttributeLock = 0x00020026,
3937  TransformMask = 0x00020027,
3938  ColorInterpolation = 0x00020028,
3939  CuttingSectionAttribute = 0x00020029,
3940 
3941  // window only attributes
3942  Debugging = 0x00020030,
3943  PostProcessEffects = 0x00020031,
3944  SelectionOptions = 0x00020032,
3945  UpdateOptions = 0x00020033,
3946 
3947  Definition = 0x00040000,
3948  NamedStyleDefinition = 0x00040001,
3949  TextureDefinition = 0x00040002,
3950  LinePatternDefinition = 0x00040003,
3951  GlyphDefinition = 0x00040004,
3952  CubeMapDefinition = 0x00040005,
3953  ImageDefinition = 0x00040006,
3954  MaterialPaletteDefinition = 0x00040007,
3955  ShaderDefinition = 0x00040008,
3956  ShapeDefinition = 0x00040009,
3957 
3958  Group = 0x00080000,
3959  SegmentGroup = 0x00080100,
3960  GeometryGroup = 0x00080200,
3961  AttributeGroup = 0x00080300,
3962  PortfolioGroup = 0x00080400,
3963  StyleGroup = 0x00080500,
3964  IncludeGroup = 0x00080600,
3965  DefinitionGroup = 0x00180000,
3966  NamedStyleDefinitionGroup = 0x00180700,
3967  TextureDefinitionGroup = 0x00180800,
3968  LinePatternDefinitionGroup = 0x00180900,
3969  GlyphDefinitionGroup = 0x00180a00,
3970  CubeMapDefinitionGroup = 0x00180b00,
3971  ImageDefinitionGroup = 0x00180c00,
3972  MaterialPaletteDefinitionGroup = 0x00180d00,
3973  ShaderDefinitionGroup = 0x00180e00,
3974  ShapeDefinitionGroup = 0x00180f00,
3975  GeometryGroupMask = 0x00280000,
3976  CuttingSectionGroup = 0x00280001,
3977  ShellGroup = 0x00280002,
3978  MeshGroup = 0x00280003,
3979  GridGroup = 0x00280004,
3980  NURBSSurfaceGroup = 0x00280005,
3981  CylinderGroup = 0x00280006,
3982  SphereGroup = 0x00280007,
3983  PolygonGroup = 0x00280008,
3984  CircleGroup = 0x00280009,
3985  CircularWedgeGroup = 0x0028000a,
3986  EllipseGroup = 0x0028000b,
3987  LineGroup = 0x0028000c,
3988  NURBSCurveGroup = 0x0028000d,
3989  CircularArcGroup = 0x0028000e,
3990  EllipticalArcGroup = 0x0028000f,
3991  InfiniteLineGroup = 0x00280010,
3992  InfiniteRayGroup = 0x00280011,
3993  MarkerGroup = 0x00280012,
3994  TextGroup = 0x00280013,
3995  ReferenceGroup = 0x00280014,
3996  DistantLightGroup = 0x00280015,
3997  SpotlightGroup = 0x00280016,
3998  };
3999 
4001  SceneTree();
4002 
4005  SceneTree(Canvas const & in_canvas);
4006 
4009  SceneTree(SceneTree const & in_that);
4010 
4013  SceneTree(SceneTree && in_that);
4014 
4015  virtual ~SceneTree();
4016 
4017  static const HPS::Type staticType = HPS::Type::SceneTree;
4018  virtual HPS::Type ObjectType() const { return staticType; }
4019 
4023  SceneTree & operator=(SceneTree const & in_that);
4024 
4028  SceneTree & operator=(SceneTree && in_that);
4029 
4033  virtual void Assign(SceneTree const & in_that);
4034 
4038  bool Equals(SceneTree const & in_that) const;
4039 
4043  bool operator!=(SceneTree const & in_that) const;
4044 
4048  bool operator==(SceneTree const & in_that) const;
4049 
4050 
4059  void SetHighlightOptions(HighlightOptionsKit const & in_options);
4060 
4070  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
4071 
4082  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
4083 
4091  void AddHighlightOptions(HighlightOptionsKit const & in_options);
4092 
4095  HighlightOptionsKitArray GetHighlightOptions() const;
4096 
4097 
4102  void SetGroupingLimit(size_t in_limit);
4103 
4106  size_t GetGroupingLimit() const;
4107 
4108 
4115  void SetRoot(SceneTreeItemPtr const & in_root);
4116 
4119  SceneTreeItemPtr GetRoot() const;
4120 
4121 
4124  virtual void Flush();
4125 
4130  void SetHighlightEventHandling(bool in_state);
4131 
4135  bool GetHighlightEventHandling() const;
4136 
4139  void ReExpand();
4140 };
4141 
4142 
4145 class SPRK_API SceneTreeItem : public Sprocket
4146 {
4147 public:
4149  SceneTreeItem();
4150 
4153  SceneTreeItem(SceneTreeItem const & in_that);
4154 
4157  SceneTreeItem(SceneTreeItem && in_that);
4158 
4164  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
4165 
4171  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
4172 
4178  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
4179 
4185  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
4186 
4194  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
4195 
4196  virtual ~SceneTreeItem();
4197 
4198  static const HPS::Type staticType = HPS::Type::SceneTreeItem;
4199  HPS::Type ObjectType() const { return staticType; }
4200 
4204  SceneTreeItem & operator=(SceneTreeItem const & in_that);
4205 
4209  SceneTreeItem & operator=(SceneTreeItem && in_that);
4210 
4214  virtual void Assign(SceneTreeItem const & in_that);
4215 
4219  bool Equals(SceneTreeItem const & in_that) const;
4220 
4224  bool operator!=(SceneTreeItem const & in_that) const;
4225 
4229  bool operator==(SceneTreeItem const & in_that) const;
4230 
4231 
4234  SceneTreePtr GetTree() const;
4235 
4238  UTF8 GetTitle() const;
4239 
4242  SceneTree::ItemType GetItemType() const;
4243 
4247  bool HasItemType(SceneTree::ItemType in_mask) const;
4248 
4251  Key GetKey() const;
4252 
4255  KeyPath GetKeyPath() const;
4256 
4259  bool HasChildren() const;
4260 
4261 
4270  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
4271 
4272 
4275  virtual void Expand();
4276 
4279  virtual void Collapse();
4280 
4281 
4286  bool IsSelected() const;
4287 
4293  virtual void Select();
4294 
4300  virtual void Unselect();
4301 
4306  bool IsHighlightable() const;
4307 
4313  bool IsHighlighted() const;
4314 
4319  void Highlight(size_t in_highlight_options_index = 0);
4320 
4326  void Highlight(HighlightOptionsKit const & in_highlight_options);
4327 
4333  void Unhighlight(size_t in_highlight_options_index = 0);
4334 
4341  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
4342 
4345  bool IsExpanded() const;
4346 
4349  void ReExpand();
4350 };
4351 
4352 
4353 
4354 class ComponentTreeItem;
4355 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
4356 class ComponentTree;
4357 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
4358 
4361 class SPRK_API ComponentTree : public Sprocket
4362 {
4363 public:
4366  enum class ItemType
4367  {
4368  None,
4369  ExchangeComponent,
4370  ExchangeModelFile,
4371 
4372  ExchangeViewGroup,
4373  ExchangeAnnotationViewGroup,
4374  ExchangePMIGroup,
4375  ExchangeModelGroup,
4376 
4377  ParasolidComponent,
4378  ParasolidModelFile,
4379 
4380  DWGComponent,
4381  DWGModelFile,
4382  };
4383 
4385  ComponentTree();
4386 
4390  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
4391 
4394  ComponentTree(ComponentTree const & in_that);
4395 
4398  ComponentTree(ComponentTree && in_that);
4399 
4400  virtual ~ComponentTree();
4401 
4402  static const HPS::Type staticType = HPS::Type::ComponentTree;
4403  virtual HPS::Type ObjectType() const { return staticType; }
4404 
4408  ComponentTree & operator=(ComponentTree const & in_that);
4409 
4413  ComponentTree & operator=(ComponentTree && in_that);
4414 
4418  virtual void Assign(ComponentTree const & in_that);
4419 
4423  bool Equals(ComponentTree const & in_that) const;
4424 
4428  bool operator!=(ComponentTree const & in_that) const;
4429 
4433  bool operator==(ComponentTree const & in_that) const;
4434 
4435 
4444  void SetHighlightOptions(HighlightOptionsKit const & in_options);
4445 
4455  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
4456 
4467  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
4468 
4478  void AddHighlightOptions(HighlightOptionsKit const & in_options);
4479 
4482  HighlightOptionsKitArray GetHighlightOptions() const;
4483 
4484 
4491  void SetRoot(ComponentTreeItemPtr const & in_root);
4492 
4495  ComponentTreeItemPtr GetRoot() const;
4496 
4497 
4500  virtual void Flush();
4501 
4504  void ReExpand();
4505 
4510  void SetHighlightEventHandling(bool in_state);
4511 
4515  bool GetHighlightEventHandling() const;
4516 };
4517 
4518 
4521 class SPRK_API ComponentTreeItem : public Sprocket
4522 {
4523 public:
4526 
4529  ComponentTreeItem(ComponentTreeItem const & in_that);
4530 
4534 
4540  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
4541 
4548  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
4549 
4550  virtual ~ComponentTreeItem();
4551 
4552  static const HPS::Type staticType = HPS::Type::ComponentTreeItem;
4553  HPS::Type ObjectType() const { return staticType; }
4554 
4558  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
4559 
4563  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
4564 
4568  virtual void Assign(ComponentTreeItem const & in_that);
4569 
4573  bool Equals(ComponentTreeItem const & in_that) const;
4574 
4578  bool operator!=(ComponentTreeItem const & in_that) const;
4579 
4583  bool operator==(ComponentTreeItem const & in_that) const;
4584 
4585 
4586 
4589  ComponentTreePtr GetTree() const;
4590 
4593  UTF8 GetTitle() const;
4594 
4597  ComponentTree::ItemType GetItemType() const;
4598 
4601  Component GetComponent() const;
4602 
4605  bool HasChildren() const;
4606 
4609  ComponentPath GetPath() const;
4610 
4611 
4619  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
4620 
4621 
4624  virtual void Expand();
4625 
4628  virtual void Collapse();
4629 
4630 
4638  bool IsHighlighted() const;
4639 
4644  virtual void OnHighlight(HighlightOptionsKit const & in_options);
4645 
4650  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
4651 
4652 
4657  void Highlight(size_t in_highlight_options_index = 0);
4658 
4664  void Highlight(HighlightOptionsKit const & in_highlight_options);
4665 
4670  void Unhighlight(size_t in_highlight_options_index = 0);
4671 
4677  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
4678 
4679 
4695  bool IsHidden() const;
4696 
4702  virtual void OnHide();
4703 
4709  virtual void OnShow();
4710 
4723  void Hide();
4724 
4737  void Show();
4738 
4751  void Isolate();
4752 
4761  void ResetVisibility();
4762 
4765  bool IsExpanded() const;
4766 
4769  void ReExpand();
4770 };
4771 
4772 
4773 
4774 
4775 }
4776 #endif
4777 
4778 
4779 
Definition: sprk.h:3410
Definition: hps.h:3488
Definition: hps.h:6349
Definition: hps.h:85
Definition: sprk.h:1005
ComponentIsolatedEvent(Event const &in_event)
Definition: sprk.h:2759
Definition: sprk.h:2739
Definition: sprk.h:3603
HPS::Type ObjectType() const
Definition: sprk.h:3491
Definition: sprk.h:273
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2820
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1204
Definition: hps.h:43422
ComponentHighlightEvent()
Definition: sprk.h:2800
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1232
Definition: hps.h:474
CameraChangedEvent(Event const &in_event)
Definition: sprk.h:1024
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1189
std::vector< SegmentKey, Allocator< SegmentKey > > SegmentKeyArray
Array of type HPS::SegmentKey.
Definition: hps.h:6777
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5953
Location
Definition: sprk.h:1463
Event * Clone() const override
Definition: sprk.h:2639
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1194
ItemType
Definition: sprk.h:4366
Definition: hps.h:5993
Event * Clone() const
Definition: sprk.h:714
CaptureActivationEvent()
Definition: sprk.h:2999
HPS::Type ObjectType() const
Definition: sprk.h:2188
Definition: sprk.h:67
Definition: sprk.h:214
Definition: sprk.h:680
PathType
Definition: sprk.h:2153
Definition: sprk.h:106
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1154
Definition: sprk.h:4521
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1164
Definition: sprk.h:3464
Event * Clone() const
Definition: sprk.h:3692
intptr_t GetChannel() const
Definition: hps.h:6466
Definition: hps.h:43205
Event * Clone() const override
Definition: sprk.h:2776
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:1037
Definition: hps.h:1372
Definition: hps.h:1067
Definition: hps.h:1766
Definition: sprk.h:242
virtual intptr_t Freshen() const
Definition: sprk.h:1047
ModelDeletedEvent()
Definition: sprk.h:966
Event * Clone() const override
Definition: sprk.h:2839
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:3674
std::vector< KeyPath, Allocator< KeyPath > > KeyPathArray
Array of type HPS::KeyPath.
Definition: hps.h:6815
Definition: sprk.h:4361
Definition: hps.h:48973
HPS::Type ObjectType() const
Definition: sprk.h:3170
Definition: sprk.h:1065
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1179
Definition: hps.h:7857
virtual UTF8 GetName() const
Definition: sprk.h:1139
Definition: hps.h:3639
Definition: hps.h:2142
HPS::Type ObjectType() const
Definition: sprk.h:3067
Definition: sprk.h:917
HPS::Type ObjectType() const
Definition: sprk.h:3290
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Definition: sprk_ops.h:19
Definition: sprk.h:768
Definition: hps.h:1455
Definition: hps.h:887
Definition: hps.h:43325
virtual void OnModelDetached()
Definition: sprk.h:1220
SmoothTransitionCompleteEvent(Event const &in_event)
Definition: sprk.h:3679
Definition: hps.h:1824
Definition: hps.h:1590
Definition: hps.h:9101
Definition: hps.h:244
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1223
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3735
Event * Clone() const override
Definition: sprk.h:2683
Definition: hps.h:1893
CameraChangedEvent()
Definition: sprk.h:1009
Definition: sprk.h:39
Definition: sprk.h:2695
SprocketKit & operator=(SprocketKit &&in_that)
Definition: sprk.h:263
virtual void OnViewAttached(HPS::View const &in_attached_view)
Definition: sprk.h:1208
HPS::Type ObjectType() const
Definition: sprk.h:3437
HPS::Type ObjectType() const
Definition: sprk.h:1116
HPS::Type ObjectType() const
Definition: sprk.h:572
Definition: hps.h:48871
Definition: hps.h:42237
Definition: sprk.h:1459
Definition: sprk.h:962
Definition: sprk.h:564
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:844
Definition: hps.h:42284
HPS::Type ObjectType() const
Definition: sprk.h:4553
LayoutDeletedEvent()
Definition: sprk.h:772
Definition: hps.h:41669
Definition: hps.h:44991
HPS::Type ObjectType() const
Definition: sprk.h:114
Definition: hps.h:1107
Definition: sprk.h:3149
HPS::Type ObjectType() const
Definition: sprk.h:2876
LayoutDetachedEvent()
Definition: sprk.h:727
Event * Clone() const
Definition: sprk.h:2941
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1227
Definition: sprk.h:3263
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1169
HPS::Type ObjectType() const
Definition: sprk.h:3339
Event * Clone() const
Definition: sprk.h:952
Definition: hps.h:10073
Definition: hps.h:43369
Definition: hps.h:1543
SmoothTransitionCompleteEvent()
Definition: sprk.h:3669
Definition: hps.h:1475
HPS::Type ObjectType() const
Definition: sprk.h:492
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1149
FilterActivationEvent()
Definition: sprk.h:2910
Definition: hps.h:1494
virtual void OnModelAttached()
Definition: sprk.h:1216
Definition: hps.h:39252
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2924
HPS::Type ObjectType() const
Definition: sprk.h:2976
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:936
Definition: hps.h:7228
HPS::Type ObjectType() const
Definition: sprk.h:1076
Location
Definition: sprk.h:1642
Definition: hps.h:48342
HPS::Type ObjectType() const
Definition: sprk.h:282
Definition: sprk.h:3214
Definition: sprk.h:1638
Definition: hps.h:45170
HPS::Type ObjectType() const
Definition: sprk.h:1899
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:235
Definition: hps.h:47232
Definition: hps.h:48758
Definition: sprk.h:723
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:3013
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1174
CanvasDeletedEvent()
Definition: sprk.h:684
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1159
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:230
Definition: hps.h:15947
HPS::Type ObjectType() const
Definition: sprk.h:4199
Event * Clone() const
Definition: sprk.h:862
ViewDeletedEvent()
Definition: sprk.h:878
Definition: sprk.h:811
SprocketKit(SprocketKit &&in_that)
Definition: sprk.h:258
Definition: sprk.h:1778
Definition: hps.h:45457
Definition: hps.h:47849
virtual bool OnTextInput(HPS::UTF8 const &in_text)
Definition: sprk.h:1199
The ComponentPath contains only components which are unique to this request, omitting ambiguous entri...
HPS::Type ObjectType() const
Definition: sprk.h:1492
HPS::Type ObjectType() const
Definition: sprk.h:1671
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:893
Definition: hps.h:38755
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1235
Definition: sprk.h:3361
Event * Clone() const
Definition: sprk.h:1054
ViewDetachedEvent()
Definition: sprk.h:822
Definition: hps.h:6433
Definition: hps.h:14195
HPS::Type ObjectType() const
Definition: sprk.h:218
std::vector< UTF8, Allocator< UTF8 > > UTF8Array
Array of type HPS::UTF8.
Definition: hps.h:6783
Definition: sprk.h:1310
HPS::Type ObjectType() const
Definition: sprk.h:3241
Event * Clone() const
Definition: sprk.h:758
Definition: hps.h:410
Definition: sprk.h:484
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:699
HPS::Type ObjectType() const
Definition: sprk.h:246
Definition: sprk.h:3728
Definition: sprk.h:2148
std::shared_ptr< Operator > OperatorPtr
Shared pointer to an Operator object.
Definition: sprk.h:84
ComponentType
Definition: sprk.h:1784
Definition: hps.h:47157
std::vector< Key, Allocator< Key > > KeyArray
Array of type HPS::Key.
Definition: hps.h:6787
Definition: hps.h:2161
Event * Clone() const
Definition: sprk.h:996
Definition: sprk.h:2789
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:742
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1144
ItemType
Definition: sprk.h:3869
HPS::Type ObjectType() const
Definition: sprk.h:1333
Definition: sprk.h:2854
Definition: sprk.h:3515
Event * Clone() const
Definition: sprk.h:908
HPS::Type ObjectType() const
Definition: sprk.h:3388
DeleteMode
Definition: sprk.h:1876
Definition: sprk.h:191
virtual void OnViewDetached(HPS::View const &in_detached_view)
Definition: sprk.h:1212
Definition: sprk.h:3665
Definition: hps.h:429
Definition: sprk.h:2954
Definition: hps.h:2181
ModelDetachedEvent()
Definition: sprk.h:921
static MouseButtons ButtonLeft()
Definition: hps.h:48460
Definition: sprk.h:3864
Definition: sprk.h:2607
Definition: sprk.h:3312
UpdateType
Definition: hps.h:178
Definition: hps.h:9259
Event * Clone() const
Definition: sprk.h:802
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1238
Definition: hps.h:7775
Definition: sprk.h:2899
Definition: hps.h:38355
Definition: hps.h:355
Event * Clone() const
Definition: sprk.h:3029
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:981
ComponentIsolatedEvent()
Definition: sprk.h:2744
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:787
Definition: hps.h:9488
Definition: hps.h:11178
Definition: sprk.h:1253
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1184
virtual HPS::Type ObjectType() const
Definition: sprk.h:4018
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:3701
Definition: sprk.h:4145
Definition: sprk.h:3041
Definition: sprk.h:2651
Definition: hps.h:43901
Mode
Definition: sprk.h:196
Definition: hps.h:515
Definition: sprk.h:1107
Definition: hps.h:1173
Definition: hps.h:43251
Definition: sprk.h:874
Definition: sprk.h:2995
virtual HPS::Type ObjectType() const
Definition: sprk.h:4403
Definition: hps.h:41733
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3608
Event * Clone() const override
Definition: sprk.h:2727
Definition: hps.h:7486