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 const & in_up_vector, HPS::Vector const & 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  * \param in_fallback_fonts An array of fonts to use in case the one specified in in_text_attributes cannot be found at runtime.
1604  * Generally this should be the same array passed to SetFallbackFonts.
1605  * If the font specified is not found at runtime, and no fallback fonts are specified, a stroked representation of the text will be
1606  * used. Non-Latin characters might render as boxes in this eventuality.
1607  * \return A reference to this object. */
1608  NavigationCubeControl & SetText(const char * in_back_string, const char * in_top_string, const char * in_left_string,
1609  const char * in_front_string, const char * in_bottom_string, const char * in_right_string,
1610  HPS::TextAttributeKit const & in_text_attributes, HPS::UTF8Array const & in_fallback_fonts = HPS::UTF8Array());
1611 
1612  /* Gets the text displayed on the navigation cube.
1613  * \param out_back_string The text displayed on the back face of the navigation cube
1614  * \param out_top_string The text displayed on the top face of the navigation cube
1615  * \param out_left_string The text displayed on the left face of the navigation cube
1616  * \param out_front_string The text displayed on the front face of the navigation cube
1617  * \param out_bottom_string The text displayed on the bottom face of the navigation cube
1618  * \param out_right_string The text displayed on the right face of the navigation cube
1619  * \param out_text_attributes The attributes applied to the text on the navigation cube
1620  * \param out_fallback_fonts The fonts that will be used if the preferred font specified when setting text could not be found at runtime. Can be empty.
1621  * \return <span class='code'>true</span> if the navigation cube text was retrieved successfully, <span class='code'>false</span> otherwise. */
1622  bool GetText(UTF8 & out_back_string, UTF8 & out_top_string, UTF8 & out_left_string,
1623  UTF8 & out_front_string, UTF8 & out_bottom_string, UTF8 & out_right_string,
1624  HPS::TextAttributeKit & out_text_attributes, HPS::UTF8Array & out_fallback_fonts) const;
1625 
1628  HPS::SegmentKey GetSegmentKey() const;
1629 
1630 private:
1633 
1635  HPS::SegmentKey GetNavigationCubeSegment() const;
1636  void SetNavigationCubeVisibilityLink(bool in_visibility) const;
1637 
1638  bool IsTextVisible() const;
1639 };
1640 
1643 class SPRK_API AxisTriadControl : public SprocketControl
1644 {
1645 public:
1646 
1647  enum class Location
1648  {
1649  TopRight,
1650  TopLeft,
1651  BottomRight,
1652  BottomLeft,
1653  Custom,
1654  };
1655 
1657  explicit AxisTriadControl(View const & in_view);
1658 
1660  AxisTriadControl(AxisTriadControl const & in_that);
1661 
1665  AxisTriadControl(AxisTriadControl && in_that);
1666 
1670  AxisTriadControl & operator=(AxisTriadControl && in_that);
1671 
1673  ~AxisTriadControl();
1674 
1675  static const HPS::Type staticType = HPS::Type::AxisTriadControl;
1676  HPS::Type ObjectType() const {return staticType;};
1677 
1679  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1680 
1689  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_position = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1690 
1693  Location GetLocation() const;
1694 
1698  AxisTriadControl & SetPosition(HPS::Rectangle const & in_position);
1699 
1702  HPS::Rectangle GetPosition() const;
1703 
1707  AxisTriadControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1708 
1711  HPS::IntRectangle GetPositionOffsets() const;
1712 
1717  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1718 
1721  bool GetVisibility() const;
1722 
1726  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1727 
1730  bool GetTextVisibility() const;
1731 
1740  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1741 
1744  HPS::UTF8 GetMaterialPalette() const;
1745 
1752  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1753 
1756  bool GetInteractivity() const;
1757 
1762  AxisTriadControl & SetSize(float in_size);
1763 
1766  float GetSize() const;
1767 
1770  HPS::SegmentKey GetSegmentKey() const;
1771 
1772 private:
1774  AxisTriadControl(){};
1775 
1777  HPS::SegmentKey GetAxisTriadSegment() const;
1778 
1779  void SetAxisVisibilityLink(bool in_visibility) const;
1780 };
1781 
1783 class SPRK_API Component : public Sprocket
1784 {
1785 public:
1786 
1789  enum class ComponentType : uint32_t
1790  {
1791  None = 0x00000000,
1792  GenericMask = 0xfffff000,
1793 
1794  ExchangeComponentMask = 0x00001000,
1795  ExchangeModelFile = 0x00001001,
1796  ExchangeProductOccurrence = 0x00001002,
1797  ExchangePartDefinition = 0x00001003,
1798 
1799  ExchangeView = 0x00001004,
1800  ExchangeFilter = 0x00001005,
1801 
1802  ExchangeRepresentationItemMask = 0x00003000,
1803  ExchangeRIBRepModel = 0x00003001,
1804  ExchangeRICurve = 0x00003002,
1805  ExchangeRIDirection = 0x00003003,
1806  ExchangeRIPlane = 0x00003004,
1807  ExchangeRIPointSet = 0x00003005,
1808  ExchangeRIPolyBRepModel = 0x00003006,
1809  ExchangeRIPolyWire = 0x00003007,
1810  ExchangeRISet = 0x00003008,
1811  ExchangeRICoordinateSystem = 0x00003009,
1812 
1813  ExchangeTopologyMask = 0x00005000,
1814  ExchangeTopoBody = 0x00005001,
1815  ExchangeTopoConnex = 0x00005002,
1816  ExchangeTopoShell = 0x00005003,
1817  ExchangeTopoFace = 0x00005004,
1818  ExchangeTopoLoop = 0x00005005,
1819  ExchangeTopoCoEdge = 0x00005006,
1820  ExchangeTopoEdge = 0x00005007,
1821  ExchangeTopoVertex = 0x00005008,
1822  ExchangeTopoSingleWireBody = 0x00005009,
1823  ExchangeTopoWireEdge = 0x0000500a,
1824 
1825  ExchangeDrawingMask = 0x00009000,
1826  ExchangeDrawingModel = 0x00009001,
1827  ExchangeDrawingView = 0x00009002,
1828  ExchangeDrawingSheet = 0x00009003,
1829  ExchangeBasicDrawingBlock = 0x00009004,
1830  ExchangeOperatorDrawingBlock = 0x00009005,
1831 
1832  ExchangePMIMask = 0x00011000,
1833  ExchangePMI = ExchangePMIMask,
1834  ExchangePMIText = 0x00011100,
1835  ExchangePMIRichText = 0x00011200,
1836  ExchangePMIRoughness = 0x00011300,
1837  ExchangePMIGDT = 0x00011400,
1838  ExchangePMIDatum = 0x00011500,
1839  ExchangePMILineWelding = 0x00011600,
1840  ExchangePMISpotWelding = 0x00011700,
1841  ExchangePMIDimension = 0x00011800,
1842  ExchangePMIBalloon = 0x00011900,
1843  ExchangePMICoordinate = 0x00011a00,
1844  ExchangePMIFastener = 0x00011b00,
1845  ExchangePMILocator = 0x00011c00,
1846  ExchangePMIMeasurementPoint = 0x00011d00,
1847 
1848 
1849  ParasolidComponentMask = 0x00020000,
1850 
1851  ParasolidModelFile = 0x00020001,
1852  ParasolidAssembly = 0x00020002,
1853  ParasolidInstance = 0x00020003,
1854 
1855  ParasolidTopologyMask = 0x00060000,
1856  ParasolidTopoBody = 0x00060001,
1857  ParasolidTopoRegion = 0x00060002,
1858  ParasolidTopoShell = 0x00060003,
1859  ParasolidTopoFace = 0x00060004,
1860  ParasolidTopoLoop = 0x00060005,
1861  ParasolidTopoFin = 0x00060006,
1862  ParasolidTopoEdge = 0x00060007,
1863  ParasolidTopoVertex = 0x00060008,
1864 
1865 
1866  DWGComponentMask = 0x00100000,
1867  DWGModelFile = 0x00100001,
1868  DWGLayout = 0x00100002,
1869  DWGBlockTable = 0x00100003,
1870  DWGBlockTableRecord = 0x00100004,
1871  DWGEntity = 0x00100005,
1872  DWGLayerTable = 0x00100006,
1873  DWGLayer = 0x00100007,
1874 
1875 
1876  UserComponent = 0x01000000,
1877  };
1878 
1881  enum class DeleteMode
1882  {
1883  Standard, // subcomponents will be deleted if they don't have multiple owners, otherwise their reference count will be decremented
1884  Full, // subcomponents will always be deleted, even if they are shared
1885  StandardAndExchange // Subcomponent will deleted if they don't have multiple owners, otherwise their reference count will be decremented.
1886  // The Exchange Entity associated to the Component will be deleted.
1887  };
1888 
1890  Component();
1891 
1894  Component(Component const & in_that);
1895 
1898  Component(Component && in_that);
1899 
1901  virtual ~Component();
1902 
1903  static const HPS::Type staticType = HPS::Type::Component;
1904  HPS::Type ObjectType() const { return staticType; }
1905 
1906 
1910  Component & operator=(Component const & in_that);
1911 
1915  Component & operator=(Component && in_that);
1916 
1920  virtual void Assign(Component const & in_that);
1921 
1925  bool Equals(Component const & in_that) const;
1926 
1930  bool operator!=(Component const & in_that) const;
1931 
1935  bool operator==(Component const & in_that) const;
1936 
1937 
1940  ComponentType GetComponentType() const;
1941 
1945  bool HasComponentType(ComponentType in_mask) const;
1946 
1947 
1948 
1954  void AddKey(Key const & in_key);
1955 
1958  KeyArray GetKeys() const;
1959 
1960 
1961 
1966  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1967 
1972  ComponentArray GetOwners() const;
1973 
1976  ComponentArray GetSubcomponents() const;
1977 
1982  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1983 
1984 
1985 
1988  void AddReference(Component & in_reference);
1989 
1996  ComponentArray GetReferrers() const;
1997 
2001  ComponentArray GetReferences() const;
2002 
2003 
2004 
2007  MetadataArray GetAllMetadata() const;
2008 
2012  Metadata GetMetadata(char const * in_name) const;
2013 
2017  UTF8 GetName() const;
2018 
2019 
2020 
2071  void Delete(HPS::Component::DeleteMode mode = HPS::Component::DeleteMode::Standard);
2072 
2076  void Flush();
2077 
2078 
2086  static KeyPathArray GetKeyPath(Component const & in_component);
2087 
2097  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
2098 
2107  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
2108 
2114  bool SetTransform(MatrixKit const & in_transform);
2115 
2121  bool AddTransform(MatrixKit const & in_transform);
2122 
2143  Component CopyTo(HPS::Component const & in_new_owner);
2144 
2149  bool SetName(char const * in_new_name);
2150 };
2151 
2153 class SPRK_API ComponentPath : public Sprocket
2154 {
2155 public:
2158  enum class PathType : uint32_t
2159  {
2160  Complete,
2161  Unique,
2162  };
2163 
2165  ComponentPath();
2166 
2169  ComponentPath(ComponentArray const & in_components);
2170 
2174  ComponentPath(size_t in_count, Component const in_components[]);
2175 
2177  ComponentPath(ComponentPath const & in_that);
2178 
2182  ComponentPath(ComponentPath && in_that);
2183 
2187  ComponentPath & operator=(ComponentPath && in_that);
2188 
2190  virtual ~ComponentPath();
2191 
2192  static const HPS::Type staticType = HPS::Type::ComponentPath;
2193  HPS::Type ObjectType() const { return staticType; }
2194 
2197  bool Empty() const;
2198 
2202  ComponentPath & operator+=(Component const & in_component);
2203 
2207  ComponentPath & operator+=(ComponentPath const & in_path);
2208 
2212  ComponentPath & operator+=(ComponentArray const & in_components);
2213 
2218  ComponentPath & Append(Component const & in_component);
2219 
2224  ComponentPath & Append(ComponentPath const & in_path);
2225 
2230  ComponentPath & Append(ComponentArray const & in_components);
2231 
2235  ComponentPath & operator=(ComponentPath const & in_that);
2236 
2240  ComponentPath & operator=(ComponentArray const & in_path);
2241 
2244  void Set(ComponentPath const & in_that);
2245 
2249  bool Equals(ComponentPath const & in_that) const;
2250 
2254  bool operator!= (ComponentPath const & in_that) const;
2255 
2259  bool operator== (ComponentPath const & in_that) const;
2260 
2261 
2265  ComponentPath & SetComponents(ComponentArray const & in_components);
2266 
2271  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
2272 
2275  ComponentArray GetComponents() const;
2276 
2280  KeyPathArray GetKeyPaths() const;
2281 
2286  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
2287 
2288 
2295  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options, bool in_remove_existing = true) const;
2296 
2303  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options, bool in_remove_existing = true) const;
2304 
2308  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2309 
2314  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2315 
2316 
2328  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2329 
2341  void Show(Canvas const & in_canvas, size_t in_layer = 0);
2342 
2354  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0) const;
2355 
2366  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
2367 
2379  static void Isolate(HPS::ComponentPathArray & in_component_paths, Canvas const & in_canvas, size_t in_layer = 0);
2380 
2390  void ResetVisibility(Canvas const & in_canvas, size_t in_layer = 0);
2391 
2402  static void ResetVisibility(HPS::ComponentPathArray & in_component_paths, Canvas const & in_canvas, size_t in_layer = 0);
2403 
2404  /* Returns the number of Components contained in this ComponentPath object.
2405  * \return the number of Components in this ComponentPath.*/
2406  size_t Size() const;
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 & At(size_t in_index);
2412 
2413  /* Access a Component in this ComponentPath object. An HPS::IndexOutOfRangeException exception is thrown if in_index is out of range.
2414  * \param in_index The index of the Component to access, zero based.
2415  * \return The Component at position in_index in this ComponentPath.*/
2416  Component const & At(size_t in_index) const;
2417 
2418  /* Inserts in_item in the ComponentPath before the element at position in_index, increasing the size of the ComponentPath by one.
2419  * An HPS::IndexOutOfRangeException exception is thrown if in_index is out of range.
2420  * \param in_index The index where in_item will be inserted
2421  * \param in_item The component to insert in this key path. */
2422  void Insert(size_t in_index, Component const & in_item);
2423 
2424  /* Traverses the components in this ComponentPath and removes the first one which matches in_item
2425  * NOTE: A useful ComponentPath should not contain duplicate components.
2426  * \param in_item The item to remove from the ComponentPath. */
2427  void Remove(Component const & in_item);
2428 
2429  /* Removes the the component at position in_index from this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if in_index is out of range.
2430  * \param in_index The index of the component to remove, zero based. */
2431  void Remove(size_t in_index);
2432 
2433  /* Creates and returns a new ComponentPath object, with the components organized in the reverse order.
2434  * \return A new ComponentPath object, containing components organized in the reverse order. */
2435  ComponentPath Reverse() const;
2436 
2437  /* Returns the first component of this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2438  * \return The first component of this ComponentPath.*/
2439  Component & Front();
2440 
2441  /* Returns the first component of this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2442  * \return The first component of this ComponentPath.*/
2443  Component const & Front() const;
2444 
2445  /* Returns the last component of this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2446  * \return The last component of this ComponentPath.*/
2447  Component & Back();
2448 
2449  /* Returns the last component of this ComponentPath. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2450  * \return The last component of this ComponentPath.*/
2451  Component const & Back() const;
2452 
2453  /* Returns the first component of this ComponentPath and returns it. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2454  * \return The first component of this ComponentPath.*/
2455  Component PopFront();
2456 
2457  /* Returns the last component of this ComponentPath and returns it. An HPS::IndexOutOfRangeException exception is thrown if the ComponentPath is empty.
2458  * \return The last component of this ComponentPath.*/
2459  Component PopBack();
2460 
2461  /* Adds in_component to the front of the ComponentPath.
2462  * \param in_component The component to add to the front of the ComponentPath.
2463  * \return A reference to this object.*/
2464  ComponentPath & PushFront(Component const & in_component);
2465 
2466  /* Adds in_component to the end of the ComponentPath.
2467  * \param in_component The component to add to the end of the ComponentPath.
2468  * \return A reference to this object.*/
2469  ComponentPath & PushBack(Component const & in_component);
2470 
2474  ComponentPath & PushBack(ComponentPath const & in_path);
2475 
2479  ComponentPath & PushBack(ComponentArray const & in_components);
2480 
2481 #ifndef HPS_GULP_CLANG
2482  using iterator = HPS::ComponentArray::iterator;
2483  using const_iterator = HPS::ComponentArray::const_iterator;
2484  using reverse_iterator = HPS::ComponentArray::reverse_iterator;
2485  using const_reverse_iterator = HPS::ComponentArray::const_reverse_iterator;
2486 
2487  /* Returns an iterator pointing to the first Component contained in this ComponentPath
2488  * \return An iterator pointing to the first Component contained in this ComponentPath. */
2489  iterator begin();
2490 
2491  /* Returns an iterator pointing to the first Component contained in this ComponentPath
2492  * \return An iterator pointing to the first Component contained in this ComponentPath. */
2493  const_iterator begin() const;
2494 
2495  /* Returns a constant iterator pointing to the last Component contained in this ComponentPath
2496  * \return A constant iterator pointing to the last Component contained in this ComponentPath. */
2497  iterator end();
2498 
2499  /* Returns a constant iterator pointing to the last Component contained in this ComponentPath
2500  * \return A constant iterator pointing to the last Component contained in this ComponentPath. */
2501  const_iterator end() const;
2502 
2503  /* Returns a constant iterator pointing to the first Component contained in this ComponentPath
2504  * \return A constant iterator pointing to the first Component contained in this ComponentPath. */
2505  const_iterator cbegin() const;
2506 
2507  /* Returns a constant iterator pointing to the last Component contained in this ComponentPath
2508  * \return A constant iterator pointing to the last Component contained in this ComponentPath. */
2509  const_iterator cend() const;
2510 
2511  /* Returns a reverse iterator pointing to the last Component contained in this ComponentPath
2512  * \return A reverse iterator pointing to the last Component contained in this ComponentPath. */
2513  reverse_iterator rbegin();
2514 
2515  /* Returns a reverse iterator pointing to the first Component contained in this ComponentPath
2516  * \return A reverse iterator pointing to the first Component contained in this ComponentPath. */
2517  reverse_iterator rend();
2518 
2519  /* Returns a constant reverse iterator pointing to the last Component contained in this ComponentPath
2520  * \return A constant reverse iterator pointing to the last Component contained in this ComponentPath. */
2521  const_reverse_iterator rbegin() const;
2522 
2523  /* Returns a constant iterator pointing to the first Component contained in this ComponentPath
2524  * \return A constant iterator pointing to the first Component contained in this ComponentPath. */
2525  const_reverse_iterator rend() const;
2526 #endif
2527 };
2528 
2529 
2534 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2535 {
2536  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2537 }
2538 
2543 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2544 {
2545  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2546 }
2547 
2552 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2553 {
2554  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2555 }
2556 
2561 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2562 {
2563  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2564 }
2565 
2570 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2571 {
2572  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2573 }
2574 
2579 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2580 {
2581  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2582 }
2583 
2588 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2589 {
2590  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2591 }
2592 
2597 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2598 {
2599  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2600 }
2601 
2606 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2607 {
2608  return HPS::ComponentPath().PushBack(in_lhs).PushBack(in_rhs);
2609 }
2610 
2612 class SPRK_API ComponentResetEvent : public HPS::Event
2613 {
2614 public:
2615 
2617  {
2618  channel = GetClassID();
2619  consumable = false;
2620  }
2621 
2622  ComponentResetEvent(HPS::ComponentPath const & in_path, HPS::Canvas const & in_canvas, size_t in_layer = 0)
2623  : Event(), path(in_path), canvas(in_canvas), layer(in_layer)
2624  {
2625  channel = GetClassID();
2626  consumable = false;
2627  }
2628 
2629  ComponentResetEvent(HPS::Event const & in_event) : Event(in_event)
2630  {
2631  if (in_event.GetChannel() == HPS::Object::ClassID<ComponentResetEvent>())
2632  {
2633  auto that = static_cast<ComponentResetEvent const &>(in_event);
2634  path = that.path;
2635  canvas = that.canvas;
2636  layer = that.layer;
2637  }
2638  else
2639  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2640  }
2641 
2642  virtual ~ComponentResetEvent() {}
2643 
2644  Event * Clone() const override
2645  {
2646  ComponentResetEvent * new_event = new ComponentResetEvent(*this);
2647  return new_event;
2648  }
2649 
2650  HPS::ComponentPath path;
2651  HPS::Canvas canvas;
2652  size_t layer;
2653 };
2654 
2656 class SPRK_API ComponentShownEvent : public HPS::Event
2657 {
2658 public:
2659 
2661  {
2662  channel = GetClassID();
2663  consumable = false;
2664  }
2665 
2666  ComponentShownEvent(HPS::ComponentPath const & in_path, HPS::Canvas const & in_canvas, size_t in_layer = 0)
2667  : Event(), path(in_path), canvas(in_canvas), layer(in_layer)
2668  {
2669  channel = GetClassID();
2670  consumable = false;
2671  }
2672 
2673  ComponentShownEvent(HPS::Event const & in_event) : Event(in_event)
2674  {
2675  if (in_event.GetChannel() == HPS::Object::ClassID<ComponentShownEvent>())
2676  {
2677  auto that = static_cast<ComponentShownEvent const &>(in_event);
2678  path = that.path;
2679  canvas = that.canvas;
2680  layer = that.layer;
2681  }
2682  else
2683  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2684  }
2685 
2686  virtual ~ComponentShownEvent() {}
2687 
2688  Event * Clone() const override
2689  {
2690  ComponentShownEvent * new_event = new ComponentShownEvent(*this);
2691  return new_event;
2692  }
2693 
2694  HPS::ComponentPath path;
2695  HPS::Canvas canvas;
2696  size_t layer;
2697 };
2698 
2700 class SPRK_API ComponentHiddenEvent : public HPS::Event
2701 {
2702 public:
2703 
2705  {
2706  channel = GetClassID();
2707  consumable = false;
2708  }
2709 
2710  ComponentHiddenEvent(HPS::ComponentPath const & in_path, HPS::Canvas const & in_canvas, size_t in_layer = 0)
2711  : Event(), path(in_path), canvas(in_canvas), layer(in_layer)
2712  {
2713  channel = GetClassID();
2714  consumable = false;
2715  }
2716 
2717  ComponentHiddenEvent(HPS::Event const & in_event) : Event(in_event)
2718  {
2719  if (in_event.GetChannel() == HPS::Object::ClassID<ComponentHiddenEvent>())
2720  {
2721  auto that = static_cast<ComponentHiddenEvent const &>(in_event);
2722  path = that.path;
2723  canvas = that.canvas;
2724  layer = that.layer;
2725  }
2726  else
2727  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2728  }
2729 
2730  virtual ~ComponentHiddenEvent() {}
2731 
2732  Event * Clone() const override
2733  {
2734  ComponentHiddenEvent * new_event = new ComponentHiddenEvent(*this);
2735  return new_event;
2736  }
2737 
2738  HPS::ComponentPath path;
2739  HPS::Canvas canvas;
2740  size_t layer;
2741 };
2742 
2744 class SPRK_API ComponentIsolatedEvent : public Event
2745 {
2746 public:
2747 
2750  {
2751  channel = GetClassID();
2752  consumable = false;
2753  }
2754 
2755  ComponentIsolatedEvent(HPS::ComponentPath const & in_path, HPS::Canvas const & in_canvas, size_t in_layer = 0)
2756  : Event(), path(in_path), canvas(in_canvas), layer(in_layer)
2757  {
2758  channel = GetClassID();
2759  consumable = false;
2760  }
2761 
2764  ComponentIsolatedEvent(Event const & in_event) : Event(in_event)
2765  {
2766  if (in_event.GetChannel() == Object::ClassID<ComponentIsolatedEvent>())
2767  {
2768  auto that = static_cast<ComponentIsolatedEvent const &>(in_event);
2769  path = that.path;
2770  canvas = that.canvas;
2771  layer = that.layer;
2772  }
2773  else
2774  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2775  }
2776 
2777  virtual ~ComponentIsolatedEvent();
2778 
2781  Event * Clone() const override
2782  {
2783  ComponentIsolatedEvent * new_event = new ComponentIsolatedEvent(*this);
2784  return new_event;
2785  }
2786 
2787  ComponentPath path;
2788  HPS::Canvas canvas;
2789  size_t layer;
2790 };
2791 
2792 
2794 class SPRK_API ComponentHighlightEvent : public Event
2795 {
2796 public:
2797  enum class Action
2798  {
2799  None = 0,
2800  Highlight,
2801  Unhighlight,
2802  };
2803 
2806  {
2807  channel = GetClassID();
2808  consumable = false;
2809  action = Action::None;
2810  }
2811 
2812  ComponentHighlightEvent(Action in_action,
2813  HPS::Canvas const & in_canvas,
2814  size_t in_layer = 0,
2815  ComponentPath const & in_path = ComponentPath(),
2816  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2817  : Event(), action(in_action), path(in_path), options(in_options), canvas(in_canvas), layer(in_layer)
2818  {
2819  channel = GetClassID();
2820  consumable = false;
2821  }
2822 
2825  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2826  {
2827  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2828  {
2829  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2830  action = that.action;
2831  path = that.path;
2832  options = that.options;
2833  canvas = that.canvas;
2834  layer = that.layer;
2835  }
2836  else
2837  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2838  }
2839 
2840  virtual ~ComponentHighlightEvent();
2841 
2844  Event * Clone() const override
2845  {
2846  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2847  return new_event;
2848  }
2849 
2850  Action action;
2851  ComponentPath path;
2852  HighlightOptionsKit options;
2853  HPS::Canvas canvas;
2854  size_t layer;
2855 };
2856 
2857 
2859 class SPRK_API Filter : public Component
2860 {
2861 public:
2863  Filter();
2864 
2868  Filter(Component const & in_that);
2869 
2872  Filter(Filter const & in_that);
2873 
2876  Filter(Filter && in_that);
2877 
2878  virtual ~Filter();
2879 
2880  static const HPS::Type staticType = HPS::Type::Filter;
2881  HPS::Type ObjectType() const { return staticType; }
2882 
2883 
2884 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2885  Filter & operator=(Filter const & in_that) = default;
2886 #endif
2887 
2891  Filter & operator=(Filter && in_that);
2892 
2893 
2896  void Activate(View const & in_view);
2897 
2900  void Deactivate(View const & in_view);
2901 };
2902 
2903 
2904 class SPRK_API FilterActivationEvent : public Event
2905 {
2906 public:
2907  enum class Action
2908  {
2909  None = 0,
2910  Activate,
2911  Deactivate,
2912  };
2913 
2916  {
2917  channel = GetClassID();
2918  consumable = false;
2919  }
2920 
2921  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2922  {
2923  channel = GetClassID();
2924  consumable = false;
2925  }
2926 
2929  FilterActivationEvent(Event const & in_event) : Event(in_event)
2930  {
2931  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2932  {
2933  auto that = static_cast<FilterActivationEvent const &>(in_event);
2934  filter = that.filter;
2935  action = that.action;
2936  view = that.view;
2937  }
2938  else
2939  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2940  }
2941 
2943 
2946  Event * Clone() const
2947  {
2948  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2949  return new_event;
2950  }
2951 
2952  Filter filter;
2953  Action action;
2954  View view;
2955 };
2956 
2957 
2959 class SPRK_API Capture : public Component
2960 {
2961 public:
2963  Capture();
2964 
2968  Capture(Component const & in_that);
2969 
2972  Capture(Capture const & in_that);
2973 
2976  Capture(Capture && in_that);
2977 
2978  virtual ~Capture();
2979 
2980  static const HPS::Type staticType = HPS::Type::Capture;
2981  HPS::Type ObjectType() const { return staticType; }
2982 
2983 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2984  Capture & operator=(Capture const & in_that) = default;
2985 #endif
2986 
2990  Capture & operator=(Capture && in_that);
2991 
2992 
2996  View Activate();
2997 };
2998 
2999 
3000 class SPRK_API CaptureActivationEvent : public Event
3001 {
3002 public:
3005  {
3006  channel = GetClassID();
3007  consumable = false;
3008  }
3009 
3010  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
3011  {
3012  channel = GetClassID();
3013  consumable = false;
3014  }
3015 
3018  CaptureActivationEvent(Event const & in_event) : Event(in_event)
3019  {
3020  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
3021  {
3022  auto that = static_cast<CaptureActivationEvent const &>(in_event);
3023  capture = that.capture;
3024  view = that.view;
3025  }
3026  else
3027  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3028  }
3029 
3031 
3034  Event * Clone() const
3035  {
3036  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
3037  return new_event;
3038  }
3039 
3040  Capture capture;
3041  View view;
3042 };
3043 
3044 
3046 class SPRK_API CADModel : public Component
3047 {
3048 public:
3050  CADModel();
3051 
3055  CADModel(Component const & in_that);
3056 
3059  CADModel(CADModel const & in_that);
3060 
3063  CADModel(CADModel && in_that);
3064 
3067  CADModel(Model const & in_that);
3068 
3069  virtual ~CADModel();
3070 
3071  static const HPS::Type staticType = HPS::Type::CADModel;
3072  HPS::Type ObjectType() const { return staticType; }
3073 
3074 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3075  CADModel & operator=(CADModel const & in_that) = default;
3076 #endif
3077 
3081  CADModel & operator=(CADModel && in_that);
3082 
3083 
3087  Component GetComponentFromKey(Key const & in_key) const;
3088 
3100  ComponentPath GetComponentPath(KeyPath const & in_key_path, ComponentPath::PathType in_path_type = ComponentPath::PathType::Unique) const;
3101 
3113  ComponentPath GetComponentPath(SelectionItem const & in_item, ComponentPath::PathType in_path_type = ComponentPath::PathType::Unique) const;
3114 
3115 
3118  Model GetModel() const;
3119 
3122  FilterArray GetAllFilters() const;
3123 
3126  CaptureArray GetAllCaptures() const;
3127 
3131  FilterArray GetActiveFilters(View const & in_view) const;
3132 
3133 
3137  View ActivateDefaultCapture();
3138 
3139 
3147  void ResetVisibility(Canvas const & in_canvas, size_t in_layer = 0);
3148 };
3149 
3150 
3151 
3154 class SPRK_API Metadata : public Sprocket
3155 {
3156 public:
3158  Metadata();
3159 
3162  Metadata(Metadata const & in_that);
3163 
3166  Metadata(Metadata && in_that);
3167 
3170  Metadata(char const * in_name);
3171 
3172  virtual ~Metadata();
3173 
3174  static const HPS::Type staticType = HPS::Type::Metadata;
3175  HPS::Type ObjectType() const { return staticType; }
3176 
3177 
3181  Metadata & operator=(Metadata const & in_that);
3182 
3186  Metadata & operator=(Metadata && in_that);
3187 
3191  virtual void Assign(Metadata const & in_that);
3192 
3196  bool Equals(Metadata const & in_that) const;
3197 
3201  bool operator!=(Metadata const & in_that) const;
3202 
3206  bool operator==(Metadata const & in_that) const;
3207 
3208 
3211  HPS::UTF8 GetName() const;
3212 
3215  void SetName(char const * in_name);
3216 };
3217 
3219 class SPRK_API IntegerMetadata : public Metadata
3220 {
3221 public:
3223  IntegerMetadata();
3224 
3228  IntegerMetadata(Metadata const & in_that);
3229 
3232  IntegerMetadata(IntegerMetadata const & in_that);
3233 
3236  IntegerMetadata(IntegerMetadata && in_that);
3237 
3241  IntegerMetadata(char const * in_name, int in_value);
3242 
3243  virtual ~IntegerMetadata();
3244 
3245  static const HPS::Type staticType = HPS::Type::IntegerMetadata;
3246  HPS::Type ObjectType() const { return staticType; }
3247 
3248 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3249  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
3250 #endif
3251 
3255  IntegerMetadata & operator=(IntegerMetadata && in_that);
3256 
3257 
3260  int GetValue() const;
3261 
3264  void SetValue(int in_value);
3265 };
3266 
3268 class SPRK_API UnsignedIntegerMetadata : public Metadata
3269 {
3270 public:
3273 
3277  UnsignedIntegerMetadata(Metadata const & in_that);
3278 
3282 
3286 
3290  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
3291 
3292  virtual ~UnsignedIntegerMetadata();
3293 
3294  static const HPS::Type staticType = HPS::Type::UnsignedIntegerMetadata;
3295  HPS::Type ObjectType() const { return staticType; }
3296 
3297 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3298  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
3299 #endif
3300 
3304  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
3305 
3306 
3309  unsigned int GetValue() const;
3310 
3313  void SetValue(unsigned int in_value);
3314 };
3315 
3317 class SPRK_API DoubleMetadata : public Metadata
3318 {
3319 public:
3321  DoubleMetadata();
3322 
3326  DoubleMetadata(Metadata const & in_that);
3327 
3330  DoubleMetadata(DoubleMetadata const & in_that);
3331 
3334  DoubleMetadata(DoubleMetadata && in_that);
3335 
3339  DoubleMetadata(char const * in_name, double in_value);
3340 
3341  virtual ~DoubleMetadata();
3342 
3343  static const HPS::Type staticType = HPS::Type::DoubleMetadata;
3344  HPS::Type ObjectType() const { return staticType; }
3345 
3346 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3347  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
3348 #endif
3349 
3353  DoubleMetadata & operator=(DoubleMetadata && in_that);
3354 
3355 
3358  double GetValue() const;
3359 
3362  void SetValue(double in_value);
3363 };
3364 
3366 class SPRK_API StringMetadata : public Metadata
3367 {
3368 public:
3370  StringMetadata();
3371 
3375  StringMetadata(Metadata const & in_that);
3376 
3379  StringMetadata(StringMetadata const & in_that);
3380 
3383  StringMetadata(StringMetadata && in_that);
3384 
3388  StringMetadata(char const * in_name, char const * in_value);
3389 
3390  virtual ~StringMetadata();
3391 
3392  static const HPS::Type staticType = HPS::Type::StringMetadata;
3393  HPS::Type ObjectType() const { return staticType; }
3394 
3395 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3396  StringMetadata & operator=(StringMetadata const & in_that) = default;
3397 #endif
3398 
3402  StringMetadata & operator=(StringMetadata && in_that);
3403 
3404 
3407  UTF8 GetValue() const;
3408 
3411  void SetValue(char const * in_value);
3412 };
3413 
3415 class SPRK_API TimeMetadata : public Metadata
3416 {
3417 public:
3419  TimeMetadata();
3420 
3424  TimeMetadata(Metadata const & in_that);
3425 
3428  TimeMetadata(TimeMetadata const & in_that);
3429 
3432  TimeMetadata(TimeMetadata && in_that);
3433 
3437  TimeMetadata(char const * in_name, unsigned int in_value);
3438 
3439  virtual ~TimeMetadata();
3440 
3441  static const HPS::Type staticType = HPS::Type::TimeMetadata;
3442  HPS::Type ObjectType() const { return staticType; }
3443 
3444 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3445  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
3446 #endif
3447 
3451  TimeMetadata & operator=(TimeMetadata && in_that);
3452 
3453 
3456  unsigned int GetValue() const;
3457 
3460  HPS::UTF8 GetValueAsString() const;
3461 
3464  void SetValue(unsigned int in_value);
3465 };
3466 
3467 
3469 class SPRK_API BooleanMetadata : public Metadata
3470 {
3471 public:
3473  BooleanMetadata();
3474 
3478  BooleanMetadata(Metadata const & in_that);
3479 
3482  BooleanMetadata(BooleanMetadata const & in_that);
3483 
3486  BooleanMetadata(BooleanMetadata && in_that);
3487 
3491  BooleanMetadata(char const * in_name, bool in_value);
3492 
3493  virtual ~BooleanMetadata();
3494 
3495  static const HPS::Type staticType = HPS::Type::BooleanMetadata;
3496  HPS::Type ObjectType() const { return staticType; }
3497 
3498 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3499  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
3500 #endif
3501 
3505  BooleanMetadata & operator=(BooleanMetadata && in_that);
3506 
3507 
3510  bool GetValue() const;
3511 
3514  void SetValue(bool in_value);
3515 };
3516 
3517 
3518 
3520 class SPRK_API Factory : public Sprocket
3521 {
3522 public:
3523 
3526  static CanvasArray GetCanvases();
3527 
3530  static LayoutArray GetLayouts();
3531 
3534  static ViewArray GetViews();
3535 
3538  static ModelArray GetModels();
3539 
3542  static CADModelArray GetCADModels();
3543 
3549  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
3550 
3551 #if TARGET_OS_ANDROID == 0 && !defined(__APPLE__)
3552 
3557  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
3558 #endif
3559 
3565  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
3566 
3570  static Layout CreateLayout(char const * in_name = "");
3571 
3575  static View CreateView(char const * in_name = "");
3576 
3580  static Model CreateModel(char const * in_name = "");
3581 
3586  static Component CreateComponent(Component const & in_owner, char const * in_name = "");
3587 
3593  static Component DeInstanceComponent(ComponentPath const & in_component_path);
3594 
3595 private:
3596  Factory() {}
3597 };
3598 
3608 class SPRK_API AxisTriadOperator : public Operator
3609 {
3610 public:
3611  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3613  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
3614 
3620  virtual bool OnMouseDown(MouseState const & in_state);
3625  virtual bool OnMouseUp(MouseState const & in_state);
3630  virtual bool OnMouseMove(MouseState const & in_state);
3631 
3636  virtual bool OnTouchDown(TouchState const & in_state);
3641  virtual bool OnTouchUp(TouchState const & in_state);
3646  virtual bool OnTouchMove(TouchState const & in_state);
3647 
3648  virtual void OnViewAttached(HPS::View const & in_attached_view);
3649 
3650 private:
3651 
3652  bool AxisOrbit(HPS::WindowPoint const & in_loc);
3653  void Transition(HPS::SelectionResults selection_results);
3654  void TranslatePoint(HPS::WindowPoint * point);
3655  bool IsEventRelevant(HPS::Point const & event_location);
3656 
3657  bool operator_active;
3658  HPS::WindowPoint start_point;
3659  HPS::Vector start_sphere_point;
3660  float axis_subwindow_width;
3661  float axis_subwindow_height;
3662  HPS::TouchID tracked_touch_ID;
3663  HPS::Rectangle axis_subwindow;
3664  HPS::IntRectangle axis_subwindow_offsets;
3665  HPS::SegmentKey axis_triad_segment;
3666 
3667 };
3668 
3671 {
3672 public:
3675  virtual ~SmoothTransitionCompleteEvent();
3676 
3679  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
3680  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
3681 
3684  SmoothTransitionCompleteEvent(Event const & in_event) : Event(in_event)
3685  {
3686  if (in_event.GetChannel() == Object::ClassID<SmoothTransitionCompleteEvent>())
3687  {
3688  auto that = static_cast<SmoothTransitionCompleteEvent const &>(in_event);
3689  view = that.view;
3690  }
3691  else
3692  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3693  }
3694 
3697  Event * Clone() const
3698  {
3700  return new_event;
3701  }
3702 
3706  virtual bool Drop(Event const * in_that_event) const
3707  {
3708  HPS_UNREFERENCED(in_that_event);
3709  return false;
3710  }
3711 
3712  HPS::View view;
3713 };
3714 
3733 class SPRK_API NavigationCubeOperator : public Operator
3734 {
3735 public:
3736  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3737  ~NavigationCubeOperator() { }
3738 
3740  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3741 
3746  virtual bool OnMouseDown(MouseState const & in_state);
3751  virtual bool OnMouseUp(MouseState const & in_state);
3756  virtual bool OnMouseMove(MouseState const & in_state);
3757 
3761  virtual bool OnTouchDown(TouchState const & in_state);
3766  virtual bool OnTouchUp(TouchState const & in_state);
3771  virtual bool OnTouchMove(TouchState const & in_state);
3772 
3773  virtual void OnViewAttached(HPS::View const & in_attached_view);
3774  virtual void OnViewDetached(HPS::View const & in_attached_view);
3775 
3776  virtual void OnModelAttached();
3777 
3782  void SetReferenceSegment(HPS::KeyPath const & in_path_to_segment);
3783 
3788  void SetReferenceSegment(HPS::KeyPathArray const & in_path_to_segments);
3789 
3793  HPS::KeyPathArray ShowReferenceSegment();
3794 
3799  void SetTransitionTime(HPS::Time const & in_time);
3800 
3803  HPS::Time GetTransitionTime() const;
3804 
3805 private:
3806  void Transition(HPS::SelectionResults const & selection_results);
3807  bool Orbit(HPS::WindowPoint const & in_loc);
3808  void TranslatePoint(HPS::WindowPoint * point);
3809  bool IsEventRelevant(HPS::Point const & event_location, HPS::KeyPath const & event_path);
3810  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3811 
3812 
3813  bool operator_active;
3814  HPS::TouchID tracked_touch_ID;
3815  HPS::WindowPoint start_point;
3816  HPS::WindowPoint down_position;
3817  HPS::Vector start_sphere_point;
3818  HPS::KeyPathArray reference_segments; //rotation and zooming happen around these segments
3819 
3820  HPS::SegmentKey nav_cube_segment;
3821  SegmentKeyArray style_segments; //in order: left / right / bottom / top / front / back
3822  UTF8Array named_styles; //in order: left / right / bottom / top / front / back
3823  HighlightOptionsKit highlight_options_kit;
3824  std::unordered_map<intptr_t, UTF8> key_to_style_map;
3825  HPS::PortfolioKey portfolio;
3826  HPS::ReferenceKeyArrayArray groups;
3827  HPS::CameraKit previous_camera;
3828  int previous_face;
3829  bool suppress_mouse_over_highlights;
3830 
3831  HPS::Rectangle nav_cube_subwindow;
3832  HPS::IntRectangle nav_cube_subwindow_offsets;
3833  float nav_cube_subwindow_width;
3834  float nav_cube_subwindow_height;
3835 
3836  int highlighted_group;
3837 
3838  bool moving;
3839  HPS::Time transition_time;
3840  HPS::SelectionOptionsKit selection_options;
3841 
3842  class SmoothTransitionCompleteEventHandler : public EventHandler
3843  {
3844  public:
3845  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3846  : handler_view(in_view), handler_moving(&in_moving) {}
3847 
3848  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3849 
3850  virtual HandleResult Handle(HPS::Event const * in_event);
3851 
3852  private:
3853  View handler_view;
3854  bool * handler_moving;
3855  };
3856 
3857  SmoothTransitionCompleteEventHandler * handler;
3858 };
3859 
3860 
3861 
3862 
3863 class SceneTreeItem;
3864 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3865 class SceneTree;
3866 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3867 
3870 class SPRK_API SceneTree : public Sprocket
3871 {
3872 public:
3875  enum class ItemType : uint32_t
3876  {
3877  None = 0x00000000,
3878  GenericMask = 0xffff0000,
3879 
3880  Segment = 0x00000001,
3881  Include = 0x00000002,
3882  ConditionalExpression = 0x00000003,
3883  StaticModelSegment = 0x00000004,
3884  AttributeFilter = 0x00000005,
3885 
3886  Geometry = 0x00010000,
3887  CuttingSection = 0x00010001,
3888  Shell = 0x00010002,
3889  Mesh = 0x00010003,
3890  Grid = 0x00010004,
3891  NURBSSurface = 0x00010005,
3892  Cylinder = 0x00010006,
3893  Sphere = 0x00010007,
3894  Polygon = 0x00010008,
3895  Circle = 0x00010009,
3896  CircularWedge = 0x0001000a,
3897  Ellipse = 0x0001000b,
3898  Line = 0x0001000c,
3899  NURBSCurve = 0x0001000d,
3900  CircularArc = 0x0001000e,
3901  EllipticalArc = 0x0001000f,
3902  InfiniteLine = 0x00010010,
3903  InfiniteRay = 0x00010011,
3904  Marker = 0x00010012,
3905  Text = 0x00010013,
3906  Reference = 0x00010014,
3907  DistantLight = 0x00010015,
3908  Spotlight = 0x00010016,
3909 
3910  Attribute = 0x00020000,
3911  Portfolio = 0x00020001,
3912  SegmentStyle = 0x00020002,
3913  NamedStyle = 0x00020003,
3914  MaterialPalette = 0x00020004,
3915  Priority = 0x00020005,
3916  Material = 0x00020006,
3917  Camera = 0x00020007,
3918  ModellingMatrix = 0x00020008,
3919  UserData = 0x00020009,
3920  TextureMatrix = 0x0002000a,
3921  Culling = 0x0002000b,
3922  CurveAttribute = 0x0002000c,
3923  CylinderAttribute = 0x0002000d,
3924  EdgeAttribute = 0x0002000e,
3925  LightingAttribute = 0x0002000f,
3926  LineAttribute = 0x00020010,
3927  MarkerAttribute = 0x00020011,
3928  SurfaceAttribute = 0x00020012,
3929  Selectability = 0x00020013,
3930  SphereAttribute = 0x00020014,
3931  Subwindow = 0x00020015,
3932  TextAttribute = 0x00020016,
3933  Transparency = 0x00020017,
3934  Visibility = 0x00020018,
3935  VisualEffects = 0x00020019,
3936  Performance = 0x00020020,
3937  DrawingAttribute = 0x00020021,
3938  HiddenLineAttribute = 0x00020022,
3939  ContourLine = 0x00020023,
3940  Condition = 0x00020024,
3941  Bounding = 0x00020025,
3942  AttributeLock = 0x00020026,
3943  TransformMask = 0x00020027,
3944  ColorInterpolation = 0x00020028,
3945  CuttingSectionAttribute = 0x00020029,
3946 
3947  // window only attributes
3948  Debugging = 0x00020030,
3949  PostProcessEffects = 0x00020031,
3950  SelectionOptions = 0x00020032,
3951  UpdateOptions = 0x00020033,
3952 
3953  Definition = 0x00040000,
3954  NamedStyleDefinition = 0x00040001,
3955  TextureDefinition = 0x00040002,
3956  LinePatternDefinition = 0x00040003,
3957  GlyphDefinition = 0x00040004,
3958  CubeMapDefinition = 0x00040005,
3959  ImageDefinition = 0x00040006,
3960  MaterialPaletteDefinition = 0x00040007,
3961  ShaderDefinition = 0x00040008,
3962  ShapeDefinition = 0x00040009,
3963 
3964  Group = 0x00080000,
3965  SegmentGroup = 0x00080100,
3966  GeometryGroup = 0x00080200,
3967  AttributeGroup = 0x00080300,
3968  PortfolioGroup = 0x00080400,
3969  StyleGroup = 0x00080500,
3970  IncludeGroup = 0x00080600,
3971  DefinitionGroup = 0x00180000,
3972  NamedStyleDefinitionGroup = 0x00180700,
3973  TextureDefinitionGroup = 0x00180800,
3974  LinePatternDefinitionGroup = 0x00180900,
3975  GlyphDefinitionGroup = 0x00180a00,
3976  CubeMapDefinitionGroup = 0x00180b00,
3977  ImageDefinitionGroup = 0x00180c00,
3978  MaterialPaletteDefinitionGroup = 0x00180d00,
3979  ShaderDefinitionGroup = 0x00180e00,
3980  ShapeDefinitionGroup = 0x00180f00,
3981  GeometryGroupMask = 0x00280000,
3982  CuttingSectionGroup = 0x00280001,
3983  ShellGroup = 0x00280002,
3984  MeshGroup = 0x00280003,
3985  GridGroup = 0x00280004,
3986  NURBSSurfaceGroup = 0x00280005,
3987  CylinderGroup = 0x00280006,
3988  SphereGroup = 0x00280007,
3989  PolygonGroup = 0x00280008,
3990  CircleGroup = 0x00280009,
3991  CircularWedgeGroup = 0x0028000a,
3992  EllipseGroup = 0x0028000b,
3993  LineGroup = 0x0028000c,
3994  NURBSCurveGroup = 0x0028000d,
3995  CircularArcGroup = 0x0028000e,
3996  EllipticalArcGroup = 0x0028000f,
3997  InfiniteLineGroup = 0x00280010,
3998  InfiniteRayGroup = 0x00280011,
3999  MarkerGroup = 0x00280012,
4000  TextGroup = 0x00280013,
4001  ReferenceGroup = 0x00280014,
4002  DistantLightGroup = 0x00280015,
4003  SpotlightGroup = 0x00280016,
4004  };
4005 
4007  SceneTree();
4008 
4011  SceneTree(Canvas const & in_canvas);
4012 
4015  SceneTree(SceneTree const & in_that);
4016 
4019  SceneTree(SceneTree && in_that);
4020 
4021  virtual ~SceneTree();
4022 
4023  static const HPS::Type staticType = HPS::Type::SceneTree;
4024  virtual HPS::Type ObjectType() const { return staticType; }
4025 
4029  SceneTree & operator=(SceneTree const & in_that);
4030 
4034  SceneTree & operator=(SceneTree && in_that);
4035 
4039  virtual void Assign(SceneTree const & in_that);
4040 
4044  bool Equals(SceneTree const & in_that) const;
4045 
4049  bool operator!=(SceneTree const & in_that) const;
4050 
4054  bool operator==(SceneTree const & in_that) const;
4055 
4056 
4065  void SetHighlightOptions(HighlightOptionsKit const & in_options);
4066 
4076  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
4077 
4088  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
4089 
4097  void AddHighlightOptions(HighlightOptionsKit const & in_options);
4098 
4101  HighlightOptionsKitArray GetHighlightOptions() const;
4102 
4103 
4108  void SetGroupingLimit(size_t in_limit);
4109 
4112  size_t GetGroupingLimit() const;
4113 
4114 
4121  void SetRoot(SceneTreeItemPtr const & in_root);
4122 
4125  SceneTreeItemPtr GetRoot() const;
4126 
4127 
4130  virtual void Flush();
4131 
4136  void SetHighlightEventHandling(bool in_state);
4137 
4141  bool GetHighlightEventHandling() const;
4142 
4145  void ReExpand();
4146 };
4147 
4148 
4151 class SPRK_API SceneTreeItem : public Sprocket
4152 {
4153 public:
4155  SceneTreeItem();
4156 
4159  SceneTreeItem(SceneTreeItem const & in_that);
4160 
4163  SceneTreeItem(SceneTreeItem && in_that);
4164 
4170  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
4171 
4177  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
4178 
4184  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
4185 
4191  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
4192 
4200  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
4201 
4202  virtual ~SceneTreeItem();
4203 
4204  static const HPS::Type staticType = HPS::Type::SceneTreeItem;
4205  HPS::Type ObjectType() const { return staticType; }
4206 
4210  SceneTreeItem & operator=(SceneTreeItem const & in_that);
4211 
4215  SceneTreeItem & operator=(SceneTreeItem && in_that);
4216 
4220  virtual void Assign(SceneTreeItem const & in_that);
4221 
4225  bool Equals(SceneTreeItem const & in_that) const;
4226 
4230  bool operator!=(SceneTreeItem const & in_that) const;
4231 
4235  bool operator==(SceneTreeItem const & in_that) const;
4236 
4237 
4240  SceneTreePtr GetTree() const;
4241 
4244  UTF8 GetTitle() const;
4245 
4248  SceneTree::ItemType GetItemType() const;
4249 
4253  bool HasItemType(SceneTree::ItemType in_mask) const;
4254 
4257  Key GetKey() const;
4258 
4261  KeyPath GetKeyPath() const;
4262 
4265  bool HasChildren() const;
4266 
4267 
4276  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
4277 
4278 
4281  virtual void Expand();
4282 
4285  virtual void Collapse();
4286 
4287 
4292  bool IsSelected() const;
4293 
4299  virtual void Select();
4300 
4306  virtual void Unselect();
4307 
4312  bool IsHighlightable() const;
4313 
4319  bool IsHighlighted() const;
4320 
4325  void Highlight(size_t in_highlight_options_index = 0);
4326 
4332  void Highlight(HighlightOptionsKit const & in_highlight_options);
4333 
4339  void Unhighlight(size_t in_highlight_options_index = 0);
4340 
4347  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
4348 
4351  bool IsExpanded() const;
4352 
4355  void ReExpand();
4356 };
4357 
4358 
4359 
4360 class ComponentTreeItem;
4361 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
4362 class ComponentTree;
4363 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
4364 
4367 class SPRK_API ComponentTree : public Sprocket
4368 {
4369 public:
4372  enum class ItemType
4373  {
4374  None,
4375  ExchangeComponent,
4376  ExchangeModelFile,
4377 
4378  ExchangeViewGroup,
4379  ExchangeAnnotationViewGroup,
4380  ExchangePMIGroup,
4381  ExchangeModelGroup,
4382 
4383  ParasolidComponent,
4384  ParasolidModelFile,
4385 
4386  DWGComponent,
4387  DWGModelFile,
4388  };
4389 
4391  ComponentTree();
4392 
4396  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
4397 
4400  ComponentTree(ComponentTree const & in_that);
4401 
4404  ComponentTree(ComponentTree && in_that);
4405 
4406  virtual ~ComponentTree();
4407 
4408  static const HPS::Type staticType = HPS::Type::ComponentTree;
4409  virtual HPS::Type ObjectType() const { return staticType; }
4410 
4414  ComponentTree & operator=(ComponentTree const & in_that);
4415 
4419  ComponentTree & operator=(ComponentTree && in_that);
4420 
4424  virtual void Assign(ComponentTree const & in_that);
4425 
4429  bool Equals(ComponentTree const & in_that) const;
4430 
4434  bool operator!=(ComponentTree const & in_that) const;
4435 
4439  bool operator==(ComponentTree const & in_that) const;
4440 
4441 
4450  void SetHighlightOptions(HighlightOptionsKit const & in_options);
4451 
4461  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
4462 
4473  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
4474 
4484  void AddHighlightOptions(HighlightOptionsKit const & in_options);
4485 
4488  HighlightOptionsKitArray GetHighlightOptions() const;
4489 
4490 
4497  void SetRoot(ComponentTreeItemPtr const & in_root);
4498 
4501  ComponentTreeItemPtr GetRoot() const;
4502 
4503 
4506  virtual void Flush();
4507 
4510  void ReExpand();
4511 
4516  void SetHighlightEventHandling(bool in_state);
4517 
4521  bool GetHighlightEventHandling() const;
4522 };
4523 
4524 
4527 class SPRK_API ComponentTreeItem : public Sprocket
4528 {
4529 public:
4532 
4535  ComponentTreeItem(ComponentTreeItem const & in_that);
4536 
4540 
4546  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
4547 
4554  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
4555 
4556  virtual ~ComponentTreeItem();
4557 
4558  static const HPS::Type staticType = HPS::Type::ComponentTreeItem;
4559  HPS::Type ObjectType() const { return staticType; }
4560 
4564  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
4565 
4569  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
4570 
4574  virtual void Assign(ComponentTreeItem const & in_that);
4575 
4579  bool Equals(ComponentTreeItem const & in_that) const;
4580 
4584  bool operator!=(ComponentTreeItem const & in_that) const;
4585 
4589  bool operator==(ComponentTreeItem const & in_that) const;
4590 
4591 
4592 
4595  ComponentTreePtr GetTree() const;
4596 
4599  UTF8 GetTitle() const;
4600 
4603  ComponentTree::ItemType GetItemType() const;
4604 
4607  Component GetComponent() const;
4608 
4611  bool HasChildren() const;
4612 
4615  ComponentPath GetPath() const;
4616 
4617 
4625  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
4626 
4627 
4630  virtual void Expand();
4631 
4634  virtual void Collapse();
4635 
4636 
4644  bool IsHighlighted() const;
4645 
4650  virtual void OnHighlight(HighlightOptionsKit const & in_options);
4651 
4656  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
4657 
4658 
4663  void Highlight(size_t in_highlight_options_index = 0);
4664 
4670  void Highlight(HighlightOptionsKit const & in_highlight_options);
4671 
4676  void Unhighlight(size_t in_highlight_options_index = 0);
4677 
4683  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
4684 
4685 
4701  bool IsHidden() const;
4702 
4708  virtual void OnHide();
4709 
4715  virtual void OnShow();
4716 
4729  void Hide();
4730 
4743  void Show();
4744 
4757  void Isolate();
4758 
4767  void ResetVisibility();
4768 
4771  bool IsExpanded() const;
4772 
4775  void ReExpand();
4776 };
4777 
4778 
4779 
4780 
4781 }
4782 #endif
4783 
4784 
4785 
Definition: sprk.h:3415
Definition: hps.h:3488
Definition: hps.h:6352
Definition: hps.h:85
Definition: sprk.h:1005
ComponentIsolatedEvent(Event const &in_event)
Definition: sprk.h:2764
Definition: sprk.h:2744
Definition: sprk.h:3608
HPS::Type ObjectType() const
Definition: sprk.h:3496
Definition: sprk.h:273
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2825
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1204
Definition: hps.h:43446
ComponentHighlightEvent()
Definition: sprk.h:2805
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:6780
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5956
Location
Definition: sprk.h:1463
Event * Clone() const override
Definition: sprk.h:2644
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1194
ItemType
Definition: sprk.h:4372
Definition: hps.h:5996
Event * Clone() const
Definition: sprk.h:714
CaptureActivationEvent()
Definition: sprk.h:3004
HPS::Type ObjectType() const
Definition: sprk.h:2193
Definition: sprk.h:67
Definition: sprk.h:214
Definition: sprk.h:680
PathType
Definition: sprk.h:2158
Definition: sprk.h:106
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1154
Definition: sprk.h:4527
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1164
Definition: sprk.h:3469
Event * Clone() const
Definition: sprk.h:3697
intptr_t GetChannel() const
Definition: hps.h:6469
Definition: hps.h:43229
Event * Clone() const override
Definition: sprk.h:2781
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:2844
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:3679
std::vector< KeyPath, Allocator< KeyPath > > KeyPathArray
Array of type HPS::KeyPath.
Definition: hps.h:6818
Definition: sprk.h:4367
Definition: hps.h:48994
HPS::Type ObjectType() const
Definition: sprk.h:3175
Definition: sprk.h:1065
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1179
Definition: hps.h:7863
virtual UTF8 GetName() const
Definition: sprk.h:1139
Definition: hps.h:3639
Definition: hps.h:2142
HPS::Type ObjectType() const
Definition: sprk.h:3072
Definition: sprk.h:917
HPS::Type ObjectType() const
Definition: sprk.h:3295
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Definition: sprk_ops.h:20
Definition: sprk.h:768
Definition: hps.h:1455
Definition: hps.h:887
Definition: hps.h:43349
virtual void OnModelDetached()
Definition: sprk.h:1220
SmoothTransitionCompleteEvent(Event const &in_event)
Definition: sprk.h:3684
Definition: hps.h:1824
Definition: hps.h:1590
Definition: hps.h:9107
Definition: hps.h:244
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1223
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3740
Event * Clone() const override
Definition: sprk.h:2688
Definition: hps.h:1893
CameraChangedEvent()
Definition: sprk.h:1009
Definition: sprk.h:39
Definition: sprk.h:2700
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:3442
HPS::Type ObjectType() const
Definition: sprk.h:1116
HPS::Type ObjectType() const
Definition: sprk.h:572
Definition: hps.h:48892
Definition: hps.h:42261
Definition: sprk.h:1459
Definition: sprk.h:962
Definition: sprk.h:564
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:844
Definition: hps.h:42308
HPS::Type ObjectType() const
Definition: sprk.h:4559
LayoutDeletedEvent()
Definition: sprk.h:772
Definition: hps.h:41693
Definition: hps.h:45015
HPS::Type ObjectType() const
Definition: sprk.h:114
Definition: hps.h:1107
Definition: sprk.h:3154
HPS::Type ObjectType() const
Definition: sprk.h:2881
LayoutDetachedEvent()
Definition: sprk.h:727
Event * Clone() const
Definition: sprk.h:2946
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1227
Definition: sprk.h:3268
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1169
HPS::Type ObjectType() const
Definition: sprk.h:3344
Event * Clone() const
Definition: sprk.h:952
Definition: hps.h:10079
Definition: hps.h:43393
Definition: hps.h:1543
SmoothTransitionCompleteEvent()
Definition: sprk.h:3674
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:2915
Definition: hps.h:1494
virtual void OnModelAttached()
Definition: sprk.h:1216
Definition: hps.h:39276
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2929
HPS::Type ObjectType() const
Definition: sprk.h:2981
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:936
Definition: hps.h:7234
HPS::Type ObjectType() const
Definition: sprk.h:1076
Location
Definition: sprk.h:1647
Definition: hps.h:48363
HPS::Type ObjectType() const
Definition: sprk.h:282
Definition: sprk.h:3219
Definition: sprk.h:1643
Definition: hps.h:45194
HPS::Type ObjectType() const
Definition: sprk.h:1904
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:235
Definition: hps.h:47253
Definition: hps.h:44274
Definition: hps.h:48779
Definition: sprk.h:723
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:3018
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:15953
HPS::Type ObjectType() const
Definition: sprk.h:4205
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:1783
Definition: hps.h:45481
Definition: hps.h:47870
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:1676
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:893
Definition: hps.h:38779
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1235
Definition: sprk.h:3366
Event * Clone() const
Definition: sprk.h:1054
ViewDetachedEvent()
Definition: sprk.h:822
Definition: hps.h:6436
Definition: hps.h:14201
HPS::Type ObjectType() const
Definition: sprk.h:218
std::vector< UTF8, Allocator< UTF8 > > UTF8Array
Array of type HPS::UTF8.
Definition: hps.h:6786
Definition: sprk.h:1310
HPS::Type ObjectType() const
Definition: sprk.h:3246
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:3733
Definition: sprk.h:2153
std::shared_ptr< Operator > OperatorPtr
Shared pointer to an Operator object.
Definition: sprk.h:84
ComponentType
Definition: sprk.h:1789
Definition: hps.h:47178
std::vector< Key, Allocator< Key > > KeyArray
Array of type HPS::Key.
Definition: hps.h:6790
Definition: hps.h:2161
Event * Clone() const
Definition: sprk.h:996
Definition: sprk.h:2794
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:742
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1144
ItemType
Definition: sprk.h:3875
HPS::Type ObjectType() const
Definition: sprk.h:1333
Definition: sprk.h:2859
Definition: sprk.h:3520
Event * Clone() const
Definition: sprk.h:908
HPS::Type ObjectType() const
Definition: sprk.h:3393
DeleteMode
Definition: sprk.h:1881
Definition: sprk.h:191
virtual void OnViewDetached(HPS::View const &in_detached_view)
Definition: sprk.h:1212
Definition: sprk.h:3670
Definition: hps.h:429
Definition: sprk.h:2959
Definition: hps.h:2181
ModelDetachedEvent()
Definition: sprk.h:921
static MouseButtons ButtonLeft()
Definition: hps.h:48481
Definition: sprk.h:3870
Definition: sprk.h:2612
Definition: sprk.h:3317
UpdateType
Definition: hps.h:178
Definition: hps.h:9265
Event * Clone() const
Definition: sprk.h:802
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1238
Definition: hps.h:7781
Definition: sprk.h:2904
Definition: hps.h:38379
Definition: hps.h:355
Event * Clone() const
Definition: sprk.h:3034
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:981
ComponentIsolatedEvent()
Definition: sprk.h:2749
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:787
Definition: hps.h:9494
Definition: hps.h:11184
Definition: sprk.h:1253
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1184
virtual HPS::Type ObjectType() const
Definition: sprk.h:4024
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:3706
Definition: sprk.h:4151
Definition: sprk.h:3046
Definition: sprk.h:2656
Definition: hps.h:43925
Mode
Definition: sprk.h:196
Definition: hps.h:515
Definition: sprk.h:1107
Definition: hps.h:1173
Definition: hps.h:43275
Definition: sprk.h:874
Definition: sprk.h:3000
virtual HPS::Type ObjectType() const
Definition: sprk.h:4409
Definition: hps.h:41757
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3613
Event * Clone() const override
Definition: sprk.h:2732
Definition: hps.h:7492