sprk.h
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef SPRK_H
11 #define SPRK_H
12 
13 #include "hps.h"
14 
15 #include <memory>
16 
17 #ifdef _MSC_VER
18 # pragma warning(disable: 4251) //Not an issue as long as debug and release libraries aren't mixed
19 #ifndef STATIC_APP
20 # ifdef SPRK
21 # define SPRK_API __declspec (dllexport)
22 # else
23 # define SPRK_API __declspec (dllimport)
24 # endif
25 #endif
26 #else
27 # include <stddef.h>
28 # if defined(LINUX_SYSTEM) && defined(SPRK)
29 # ifndef STATIC_APP
30 # define SPRK_API __attribute__ ((visibility ("default")))
31 # endif
32 # endif
33 #endif
34 
35 #ifndef SPRK_API
36 # define SPRK_API
37 #endif
38 namespace SPRKI
39 {
40  class X;
41 };
42 
43 namespace HPS
44 {
45 
46 class Factory;
47 class Canvas;
48 class Layout;
49 class View;
50 class Model;
51 class Operator;
52 class OperatorControl;
53 class NavigationCubeControl;
54 class AxisTriadControl;
55 class Component;
56 class ComponentPath;
57 class ComponentHighlightEvent;
58 class Filter;
59 class Capture;
60 class CADModel;
61 class Metadata;
62 
63 
64 
65 
66 class SPRK_API Sprocket : public HPS::Object
67 {
68 public:
69  Sprocket() {}
70 #if !defined(_MSC_VER) || _MSC_VER >= 1900
71  Sprocket(HPS::Sprocket const & in_that) = default;
72 #endif
73  Sprocket(Sprocket && in_that) : HPS::Object(std::move(in_that)) {}
74 
75  virtual ~Sprocket() {}
76 };
77 
78 typedef std::shared_ptr<Operator> OperatorPtr;
79 
80 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
81 
82 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
83 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
84 typedef std::vector<View, Allocator<View> > ViewArray;
85 typedef std::vector<Model, Allocator<Model> > ModelArray;
86 
87 typedef std::vector<Component, Allocator<Component> > ComponentArray;
88 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
89 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
90 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
91 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
92 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
93 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
94 typedef std::vector<HighlightOptionsKit, Allocator<HighlightOptionsKit>> HighlightOptionsKitArray;
95 
96 
100 class SPRK_API Canvas : public Sprocket
101 {
102 public:
103  Canvas();
104  Canvas(Canvas const & that);
105  ~Canvas();
106 
107  HPS::Type ObjectType() const { return HPS::Type::Canvas; }
108 
110  void Delete();
111 
112  Canvas & operator=(Canvas const & in_that);
113  void Assign(Canvas const & in_that);
114 
115  bool Equals(Canvas const & in_that) const;
116  bool operator!= (Canvas const & in_that) const;
117  bool operator== (Canvas const & in_that) const;
118 
120  UTF8 GetName() const;
121 
125  void AttachLayout(Layout const & in_layout);
126 
130  void AttachViewAsLayout(View const & in_view);
131 
133  void DetachLayout();
134 
136  Layout GetAttachedLayout() const;
137 
139  IncludeKey GetAttachedLayoutIncludeLink() const;
140 
142  View GetFrontView() const;
143 
144  WindowKey const GetWindowKey() const;
145 
148  WindowKey GetWindowKey();
149 
150  PortfolioKey const GetPortfolioKey() const;
151 
153  PortfolioKey GetPortfolioKey();
154 
156  void Update() const;
157 
160  UpdateNotifier UpdateWithNotifier() const;
161 
165  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
166 
171  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
172 
176  void SetFrameRate(float in_frame_rate=20);
177 
181  float GetFrameRate() const;
182 };
183 
184 class SPRK_API Rendering
185 {
186 public:
189  enum class Mode
190  {
191  Gouraud,
192  GouraudWithLines,
193  Flat,
194  FlatWithLines,
195  Phong,
196  PhongWithLines,
197  HiddenLine,
198  FastHiddenLine,
199  Wireframe,
200  Default = Phong
201  };
202 
203 private:
204  Rendering() {}
205 };
206 
207 class SPRK_API SprocketControl : public Sprocket
208 {
209 public:
210  HPS::Type ObjectType() const {return HPS::Type::SprocketControl;}
211 
212 #if !defined(_MSC_VER) || _MSC_VER >= 1900
213  SprocketControl(HPS::SprocketControl const & in_that) = default;
214 #endif
215 
216 protected:
217  SprocketControl() {}
218 
222  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
223 
228  {
229  this->Object::operator=(std::move(in_that));
230  return *this;
231  }
232 };
233 
237 class SPRK_API View : public Sprocket
238 {
239 public:
240  View();
241  View(View const & that);
242  explicit View(SprocketControl const & in_ctrl);
243  ~View();
244 
245  HPS::Type ObjectType() const { return HPS::Type::View; }
246 
248  void Delete();
249 
250  View & operator=(View const & in_that);
251  void Assign(View const & in_that);
252 
253  bool Equals(View const & in_that) const;
254  bool operator!= (View const & in_that) const;
255  bool operator== (View const & in_that) const;
256 
258  UTF8 GetName() const;
259 
260 
263  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
264 
268  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
269 
270 
274  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
275 
281  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
282 
283 
289  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
290 
291 
293  HPS::View & FitWorld();
294 
297  HPS::View & FitWorld(SegmentKey const & in_segment);
298 
299 
302  HPS::View & FitWorld(BoundingKit const & in_bounding);
303 
308  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
309 
310 
315  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
316 
321  void AttachModel(Model const & in_model);
322 
324  void DetachModel();
325 
327  Model GetAttachedModel() const;
328 
330  IncludeKey GetAttachedModelIncludeLink() const;
331 
335  void SetRenderingMode(Rendering::Mode in_mode);
336 
339  Rendering::Mode GetRenderingMode() const;
340 
342  OperatorPtrArray GetOperators() const;
343 
346  void SetOperators(OperatorPtrArray & in_operators);
347 
351  void SetOperators(size_t in_count, OperatorPtr in_operators []);
352 
355  void SetOperator(OperatorPtr const & in_operator);
356 
359  void SetOperator(Operator * in_operator);
360 
362  OperatorControl GetOperatorControl();
363  OperatorControl const GetOperatorControl() const;
364 
366  NavigationCubeControl GetNavigationCubeControl();
367  NavigationCubeControl const GetNavigationCubeControl() const;
368 
370  AxisTriadControl GetAxisTriadControl();
371  AxisTriadControl const GetAxisTriadControl() const;
372 
375  SegmentKey GetSegmentKey();
376  SegmentKey const GetSegmentKey() const;
377 
380  SegmentKey GetModelOverrideSegmentKey();
381  SegmentKey const GetModelOverrideSegmentKey() const;
382 
383 
384  PortfolioKey const GetPortfolioKey() const;
385 
387  PortfolioKey GetPortfolioKey();
388 
393  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
394 
396  bool GetSimpleShadow();
397 
402  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
403 
405  bool GetSimpleReflection();
406 
408  void Update() const;
409 
412  UpdateNotifier UpdateWithNotifier() const;
413 
417  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
418 
424  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
425 
429  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
430 
431  static UTF8 GetHideStyleName();
432  static UTF8 GetShowStyleName();
433 
435  KeyArray const GetNavigationKeys();
436 
438  LayoutArray GetOwningLayouts();
439  LayoutArray const GetOwningLayouts() const;
440 };
441 
445 class SPRK_API Model : public Sprocket
446 {
447 public:
448  Model();
449  Model(Model const & that);
450  ~Model();
451 
452  HPS::Type ObjectType() const { return HPS::Type::Model; }
453 
455  void Delete();
456 
457  Model & operator=(Model const & in_that);
458  void Assign(Model const & in_that);
459 
460  bool Equals(Model const & in_that) const;
461  bool operator!= (Model const & in_that) const;
462  bool operator== (Model const & in_that) const;
463 
465  UTF8 GetName() const;
466 
469  SegmentKey GetSegmentKey();
470  SegmentKey const GetSegmentKey() const;
471 
473  SegmentKey GetLibraryKey();
474  SegmentKey const GetLibraryKey() const;
475 
477  PortfolioKey GetPortfolioKey();
478  PortfolioKey const GetPortfolioKey() const;
479 
481  HPS::Vector GetUpVector();
482  HPS::Vector const GetUpVector() const;
483 
485  HPS::Vector GetFrontVector();
486  HPS::Vector const GetFrontVector() const;
487 
489  HPS::ViewArray GetOwningViews();
490  HPS::ViewArray const GetOwningViews() const;
491 
495  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
496 
498  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector);
499 
501  void Update() const;
502 
505  UpdateNotifier UpdateWithNotifier() const;
506 
510  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
511 
517  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
518 
519 };
520 
524 class SPRK_API Layout : public Sprocket
525 {
526 public:
527  Layout();
528  Layout(Layout const & that);
529  ~Layout();
530 
531  HPS::Type ObjectType() const { return HPS::Type::Layout; }
532 
534  void Delete();
535 
536  Layout & operator=(Layout const & in_that);
537  void Assign(Layout const & in_that);
538 
539  bool Equals(Layout const & in_that) const;
540  bool operator!= (Layout const & in_that) const;
541  bool operator== (Layout const & in_that) const;
542 
544  UTF8 GetName() const;
545 
547  size_t GetLayerCount() const;
548 
552  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
556  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
557 
560  void DetachLayer(size_t in_layer);
561 
564  void DetachView(View const & in_view); // everywhere it occurs
565 
568  void BringToFront(size_t in_layer);
569 
573  void ReassignLayer(size_t in_layer, HPS::View in_view);
574 
578  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
579 
581  View GetFrontView() const;
582 
586  View GetAttachedView(size_t in_layer = 0) const;
587 
591  Rectangle GetPosition(size_t in_layer) const;
592 
594  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
595 
597  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
598 
602  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
603 
607  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
608 
611  SegmentKey GetSegmentKey();
612  SegmentKey const GetSegmentKey() const;
613 
615  CanvasArray GetOwningCanvases();
616  CanvasArray const GetOwningCanvases() const;
617 
619  void Update() const;
620 
623  UpdateNotifier UpdateWithNotifier() const;
624 
628  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
629 
635  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
636 
637 };
638 
639 class SPRK_API CanvasDeletedEvent : public Event
640 {
641 public:
644  {
645  channel = GetClassID();
646  consumable = false;
647  }
648 
649  CanvasDeletedEvent(Canvas const & in_canvas)
650  : Event(), canvas(in_canvas)
651  {
652  channel = GetClassID();
653  consumable = false;
654  }
655 
658  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
659  {
660  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
661  {
662  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
663  canvas = that.canvas;
664  }
665  else
666  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
667  }
668 
670 
673  Event * Clone() const
674  {
675  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
676  return new_event;
677  }
678 
679  Canvas canvas;
680 };
681 
682 class SPRK_API LayoutDetachedEvent : public Event
683 {
684 public:
687  {
688  channel = GetClassID();
689  consumable = false;
690  }
691 
692  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
693  : Event(), canvas(in_canvas), layout(in_layout)
694  {
695  channel = GetClassID();
696  consumable = false;
697  }
698 
701  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
702  {
703  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
704  {
705  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
706  canvas = that.canvas;
707  layout = that.layout;
708  }
709  else
710  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
711  }
712 
714 
717  Event * Clone() const
718  {
719  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
720  return new_event;
721  }
722 
723  Canvas canvas;
724  Layout layout;
725 };
726 
727 class SPRK_API LayoutDeletedEvent : public Event
728 {
729 public:
732  {
733  channel = GetClassID();
734  consumable = false;
735  }
736 
737  LayoutDeletedEvent(Layout const & in_layout)
738  : Event(), layout(in_layout)
739  {
740  channel = GetClassID();
741  consumable = false;
742  }
743 
746  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
747  {
748  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
749  {
750  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
751  layout = that.layout;
752  }
753  else
754  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
755  }
756 
758 
761  Event * Clone() const
762  {
763  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
764  return new_event;
765  }
766 
767  Layout layout;
768 };
769 
770 class SPRK_API ViewDetachedEvent : public Event
771 {
772 public:
773  enum class Action
774  {
775  None = 0,
776  SpecificLayer,
777  AllLayers,
778  };
779 
781  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
782  {
783  channel = GetClassID();
784  consumable = false;
785  }
786 
787  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
788  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
789  {
790  channel = GetClassID();
791  consumable = false;
792  }
793 
794  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
795  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
796  {
797  channel = GetClassID();
798  consumable = false;
799  }
800 
803  ViewDetachedEvent(Event const & in_event) : Event(in_event)
804  {
805  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
806  {
807  auto that = static_cast<ViewDetachedEvent const &>(in_event);
808  layout = that.layout;
809  action = that.action;
810  layer = that.layer;
811  view = that.view;
812  }
813  else
814  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
815  }
816 
818 
821  Event * Clone() const
822  {
823  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
824  return new_event;
825  }
826 
827  Layout layout;
828  Action action;
829  size_t layer;
830  View view;
831 };
832 
833 class SPRK_API ViewDeletedEvent : public Event
834 {
835 public:
838  {
839  channel = GetClassID();
840  consumable = false;
841  }
842 
843  ViewDeletedEvent(View const & in_view)
844  : Event(), view(in_view)
845  {
846  channel = GetClassID();
847  consumable = false;
848  }
849 
852  ViewDeletedEvent(Event const & in_event) : Event(in_event)
853  {
854  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
855  {
856  auto that = static_cast<ViewDeletedEvent const &>(in_event);
857  view = that.view;
858  }
859  else
860  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
861  }
862 
863  ~ViewDeletedEvent();
864 
867  Event * Clone() const
868  {
869  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
870  return new_event;
871  }
872 
873  View view;
874 };
875 
876 class SPRK_API ModelDetachedEvent : public Event
877 {
878 public:
881  {
882  channel = GetClassID();
883  consumable = false;
884  }
885 
886  ModelDetachedEvent(View const & in_view, Model const & in_model)
887  : Event(), view(in_view), model(in_model)
888  {
889  channel = GetClassID();
890  consumable = false;
891  }
892 
895  ModelDetachedEvent(Event const & in_event) : Event(in_event)
896  {
897  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
898  {
899  auto that = static_cast<ModelDetachedEvent const &>(in_event);
900  view = that.view;
901  model = that.model;
902  }
903  else
904  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
905  }
906 
908 
911  Event * Clone() const
912  {
913  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
914  return new_event;
915  }
916 
917  View view;
918  Model model;
919 };
920 
921 class SPRK_API ModelDeletedEvent : public Event
922 {
923 public:
926  {
927  channel = GetClassID();
928  consumable = false;
929  }
930 
931  ModelDeletedEvent(Model const & in_model)
932  : Event(), model(in_model)
933  {
934  channel = GetClassID();
935  consumable = false;
936  }
937 
940  ModelDeletedEvent(Event const & in_event) : Event(in_event)
941  {
942  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
943  {
944  auto that = static_cast<ModelDeletedEvent const &>(in_event);
945  model = that.model;
946  }
947  else
948  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
949  }
950 
952 
955  Event * Clone() const
956  {
957  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
958  return new_event;
959  }
960 
961  Model model;
962 };
963 
964 class SPRK_API CameraChangedEvent : public Event
965 {
966 public:
969  {
970  channel = GetClassID();
971  consumable = false;
972  }
973 
974  CameraChangedEvent(View const & in_view)
975  : Event(), view(in_view)
976  {
977  channel = GetClassID();
978  consumable = false;
979  }
980 
983  CameraChangedEvent(Event const & in_event) : Event(in_event)
984  {
985  if (in_event.GetChannel() == Object::ClassID<CameraChangedEvent>())
986  {
987  auto that = static_cast<CameraChangedEvent const &>(in_event);
988  view = that.view;
989  }
990  else
991  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
992  }
993 
995 
996  virtual bool Drop(Event const * in_that_event) const
997  {
998  CameraChangedEvent const * that_event = static_cast<CameraChangedEvent const *>(in_that_event);
999 
1000  if (view == that_event->view)
1001  return true;
1002 
1003  return false;
1004  }
1005 
1006  virtual intptr_t Freshen() const
1007  {
1008  return GetClassID();
1009  }
1010 
1013  Event * Clone() const
1014  {
1015  CameraChangedEvent * new_event = new CameraChangedEvent(*this);
1016  return new_event;
1017  }
1018 
1019  View view;
1020 };
1021 
1024 class SPRK_API SprocketPath : public Sprocket
1025 {
1026 public:
1027  SprocketPath();
1028  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
1029  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
1030  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
1031  SprocketPath(SprocketPath const & that);
1032  ~SprocketPath();
1033 
1034  HPS::Type ObjectType() const { return HPS::Type::SprocketPath; }
1035 
1036  SprocketPath & operator=(SprocketPath const & in_that);
1037  void Set(SprocketPath const & in_that);
1038 
1039  bool Equals(SprocketPath const & in_that) const;
1040  bool operator!= (SprocketPath const & in_that) const;
1041  bool operator== (SprocketPath const & in_that) const;
1042 
1044  Canvas GetCanvas() const;
1045 
1047  Layout GetLayout() const;
1048 
1050  View GetView() const;
1051 
1053  Model GetModel() const;
1054 
1059  KeyPath GetKeyPath() const;
1060 };
1061 
1062 
1065 class SPRK_API Operator : public Sprocket
1066 {
1067 public:
1068  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1069  Operator(Operator const & in_that);
1070 
1071  virtual ~Operator();
1072 
1073  HPS::Type ObjectType() const { return HPS::Type::Operator; }
1074 
1075  virtual Operator & operator= (Operator const & in_that);
1076 
1078  virtual void Assign(Operator const & in_that);
1079 
1081  virtual bool Equals(Operator const & in_that) const;
1082 
1084  virtual bool operator!= (Operator const & in_that) const;
1085 
1087  virtual bool operator== (Operator const & in_that) const;
1088 
1090  void DetachView();
1091 
1093  View GetAttachedView() const;
1094 
1096  virtual UTF8 GetName() const { return "Operator"; }
1097 
1101  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1102 
1106  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1107 
1111  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1112 
1116  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1117 
1121  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1122 
1126  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1127 
1131  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1132 
1136  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1137 
1141  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1142 
1146  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1147 
1151  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1152 
1156  virtual bool OnTextInput(HPS::UTF8 const & in_text) { HPS_UNREFERENCED(in_text); return false; }
1157 
1161  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1162 
1164  virtual void OnViewAttached() { return; }
1165 
1167  virtual void OnViewDetached() { return; }
1168 
1171  virtual void OnModelAttached() { return; }
1172 
1175  virtual void OnModelDetached() { return; }
1176 
1178  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1179 
1182  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1183 
1187  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1188 
1190  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1191 
1193  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1194 
1195  enum class Priority
1196  {
1197  Low,
1198  Default,
1199  High
1200  };
1201 
1202 protected:
1203 
1204  HPS::MouseButtons mouse_trigger;
1205  HPS::ModifierKeys modifier_trigger;
1206 };
1207 
1210 class SPRK_API OperatorControl : public SprocketControl
1211 {
1212 public:
1214  explicit OperatorControl(View const & in_view);
1215 
1217  OperatorControl(OperatorControl const & in_that);
1218 
1222  OperatorControl(OperatorControl && in_that);
1223 
1227  OperatorControl & operator=(OperatorControl && in_that);
1228 
1230  ~OperatorControl();
1231 
1232  HPS::Type ObjectType() const {return HPS::Type::OperatorControl;};
1233 
1235  OperatorControl & operator=(OperatorControl const & in_that);
1236 
1237 
1239  size_t GetCount();
1240 
1243  size_t GetCount(Operator::Priority in_priority);
1244 
1245 
1251  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1252 
1258  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1259 
1263  bool Pop(Operator::Priority in_priority = Operator::Priority::Default);
1264 
1269  bool Pop(OperatorPtr & out_operator);
1270 
1276  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1277 
1278 
1284  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1285 
1291  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1292 
1298  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Default);
1299 
1306  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Default);
1307 
1308 
1312  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Default);
1313 
1317  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1318 
1321  OperatorControl & UnsetEverything();
1322 
1323 
1327  bool ShowTop(OperatorPtr & out_operator) const;
1328 
1333  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1334 
1338  bool Show(OperatorPtrArray & out_operators) const;
1339 
1344  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1345 
1346 private:
1348  OperatorControl() {}
1349 };
1350 
1354 {
1355 public:
1356 
1357  enum class Location
1358  {
1359  TopRight,
1360  TopLeft,
1361  BottomRight,
1362  BottomLeft,
1363  Custom,
1364  };
1365 
1367  explicit NavigationCubeControl(View const & in_view);
1368 
1371 
1376 
1380  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1381 
1384 
1385  HPS::Type ObjectType() const {return HPS::Type::NavigationCubeControl;};
1386 
1388  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1389 
1398  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1399 
1402  Location GetLocation() const;
1403 
1407  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1408 
1411  HPS::Rectangle GetPosition() const;
1412 
1416  NavigationCubeControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1417 
1420  HPS::IntRectangle GetPositionOffsets() const;
1421 
1426  NavigationCubeControl & SetVisibility(bool in_visibility);
1427 
1430  bool GetVisibility() const;
1431 
1435  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1436 
1439  bool GetTextVisibility() const;
1440 
1455  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1456 
1459  HPS::UTF8 GetMaterialPalette() const;
1460 
1468  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1469 
1470 
1473  bool GetInteractivity() const;
1474 
1479  NavigationCubeControl & SetSize(float in_size);
1480 
1483  float GetSize() const;
1484 
1487  HPS::SegmentKey GetSegmentKey() const;
1488 
1489 private:
1492 
1494  HPS::SegmentKey GetNavigationCubeSegment() const;
1495 };
1496 
1499 class SPRK_API AxisTriadControl : public SprocketControl
1500 {
1501 public:
1502 
1503  enum class Location
1504  {
1505  TopRight,
1506  TopLeft,
1507  BottomRight,
1508  BottomLeft,
1509  Custom,
1510  };
1511 
1513  explicit AxisTriadControl(View const & in_view);
1514 
1516  AxisTriadControl(AxisTriadControl const & in_that);
1517 
1521  AxisTriadControl(AxisTriadControl && in_that);
1522 
1526  AxisTriadControl & operator=(AxisTriadControl && in_that);
1527 
1529  ~AxisTriadControl();
1530 
1531  HPS::Type ObjectType() const {return HPS::Type::AxisTriadControl;};
1532 
1534  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1535 
1544  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_position = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1545 
1548  Location GetLocation() const;
1549 
1553  AxisTriadControl & SetPosition(HPS::Rectangle const & in_position);
1554 
1557  HPS::Rectangle GetPosition() const;
1558 
1562  AxisTriadControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1563 
1566  HPS::IntRectangle GetPositionOffsets() const;
1567 
1572  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1573 
1576  bool GetVisibility() const;
1577 
1581  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1582 
1585  bool GetTextVisibility() const;
1586 
1595  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1596 
1599  HPS::UTF8 GetMaterialPalette() const;
1600 
1607  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1608 
1611  bool GetInteractivity() const;
1612 
1617  AxisTriadControl & SetSize(float in_size);
1618 
1621  float GetSize() const;
1622 
1625  HPS::SegmentKey GetSegmentKey() const;
1626 
1627 private:
1629  AxisTriadControl(){};
1630 
1632  HPS::SegmentKey GetAxisTriadSegment() const;
1633 };
1634 
1636 class SPRK_API Component : public Sprocket
1637 {
1638 public:
1641  enum class ComponentType : uint32_t
1642  {
1643  None = 0x00000000,
1644  GenericMask = 0xfffff000,
1645 
1646  ExchangeComponentMask = 0x00001000,
1647  ExchangeModelFile = 0x00001001,
1648  ExchangeProductOccurrence = 0x00001002,
1649  ExchangePartDefinition = 0x00001003,
1650 
1651  ExchangeView = 0x00001004,
1652  ExchangeFilter = 0x00001005,
1653 
1654  ExchangeRepresentationItemMask = 0x00003000,
1655  ExchangeRIBRepModel = 0x00003001,
1656  ExchangeRICurve = 0x00003002,
1657  ExchangeRIDirection = 0x00003003,
1658  ExchangeRIPlane = 0x00003004,
1659  ExchangeRIPointSet = 0x00003005,
1660  ExchangeRIPolyBRepModel = 0x00003006,
1661  ExchangeRIPolyWire = 0x00003007,
1662  ExchangeRISet = 0x00003008,
1663  ExchangeRICoordinateSystem = 0x00003009,
1664 
1665  ExchangeTopologyMask = 0x00005000,
1666  ExchangeTopoBody = 0x00005001,
1667  ExchangeTopoConnex = 0x00005002,
1668  ExchangeTopoShell = 0x00005003,
1669  ExchangeTopoFace = 0x00005004,
1670  ExchangeTopoLoop = 0x00005005,
1671  ExchangeTopoCoEdge = 0x00005006,
1672  ExchangeTopoEdge = 0x00005007,
1673  ExchangeTopoVertex = 0x00005008,
1674  ExchangeTopoSingleWireBody = 0x00005009,
1675  ExchangeTopoWireEdge = 0x0000500a,
1676 
1677  ExchangeDrawingMask = 0x00009000,
1678  ExchangeDrawingModel = 0x00009001,
1679  ExchangeDrawingView = 0x00009002,
1680  ExchangeDrawingSheet = 0x00009003,
1681  ExchangeBasicDrawingBlock = 0x00009004,
1682  ExchangeOperatorDrawingBlock = 0x00009005,
1683 
1684  ExchangePMIMask = 0x00011000,
1685  ExchangePMI = ExchangePMIMask,
1686  ExchangePMIText = 0x00011100,
1687  ExchangePMIRichText = 0x00011200,
1688  ExchangePMIRoughness = 0x00011300,
1689  ExchangePMIGDT = 0x00011400,
1690  ExchangePMIDatum = 0x00011500,
1691  ExchangePMILineWelding = 0x00011600,
1692  ExchangePMISpotWelding = 0x00011700,
1693  ExchangePMIDimension = 0x00011800,
1694  ExchangePMIBalloon = 0x00011900,
1695  ExchangePMICoordinate = 0x00011a00,
1696  ExchangePMIFastener = 0x00011b00,
1697  ExchangePMILocator = 0x00011c00,
1698  ExchangePMIMeasurementPoint = 0x00011d00,
1699 
1700 
1701  ParasolidComponentMask = 0x00020000,
1702 
1703  ParasolidModelFile = 0x00020001,
1704  ParasolidAssembly = 0x00020002,
1705  ParasolidInstance = 0x00020003,
1706 
1707  ParasolidTopologyMask = 0x00060000,
1708  ParasolidTopoBody = 0x00060001,
1709  ParasolidTopoRegion = 0x00060002,
1710  ParasolidTopoShell = 0x00060003,
1711  ParasolidTopoFace = 0x00060004,
1712  ParasolidTopoLoop = 0x00060005,
1713  ParasolidTopoFin = 0x00060006,
1714  ParasolidTopoEdge = 0x00060007,
1715  ParasolidTopoVertex = 0x00060008,
1716 
1717 
1718  DWGComponentMask = 0x00100000,
1719  DWGModelFile = 0x00100001,
1720  DWGLayout = 0x00100002,
1721  DWGBlockTable = 0x00100003,
1722  DWGBlockTableRecord = 0x00100004,
1723  DWGEntity = 0x00100005,
1724  DWGLayerTable = 0x00100006,
1725  DWGLayer = 0x00100007,
1726 
1727 
1728  UserComponent = 0x01000000,
1729  };
1730 
1731 
1733  Component();
1734 
1737  Component(Component const & in_that);
1738 
1741  Component(Component && in_that);
1742 
1744  virtual ~Component();
1745 
1746  HPS::Type ObjectType() const { return HPS::Type::Component; }
1747 
1748 
1752  Component & operator=(Component const & in_that);
1753 
1757  Component & operator=(Component && in_that);
1758 
1762  virtual void Assign(Component const & in_that);
1763 
1767  bool Equals(Component const & in_that) const;
1768 
1772  bool operator!=(Component const & in_that) const;
1773 
1777  bool operator==(Component const & in_that) const;
1778 
1779 
1782  ComponentType GetComponentType() const;
1783 
1787  bool HasComponentType(ComponentType in_mask) const;
1788 
1789 
1790 
1796  void AddKey(Key const & in_key);
1797 
1800  KeyArray GetKeys() const;
1801 
1802 
1803 
1808  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1809 
1813  ComponentArray GetOwners() const;
1814 
1817  ComponentArray GetSubcomponents() const;
1818 
1823  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1824 
1825 
1826 
1829  void AddReference(Component & in_reference);
1830 
1833  ComponentArray GetReferrers() const;
1834 
1838  ComponentArray GetReferences() const;
1839 
1840 
1841 
1844  MetadataArray GetAllMetadata() const;
1845 
1849  Metadata GetMetadata(char const * in_name) const;
1850 
1854  UTF8 GetName() const;
1855 
1856 
1857 
1862  void Delete();
1863 
1867  void Flush();
1868 
1869 
1877  static KeyPathArray GetKeyPath(Component const & in_component);
1878 
1888  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
1889 
1898  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
1899 };
1900 
1902 class SPRK_API ComponentPath : public Sprocket
1903 {
1904 public:
1906  ComponentPath();
1907 
1910  ComponentPath(ComponentArray const & in_components);
1911 
1915  ComponentPath(size_t in_count, Component const in_components[]);
1916 
1918  ComponentPath(ComponentPath const & in_that);
1919 
1923  ComponentPath(ComponentPath && in_that);
1924 
1928  ComponentPath & operator=(ComponentPath && in_that);
1929 
1931  virtual ~ComponentPath();
1932 
1933  HPS::Type ObjectType() const { return HPS::Type::ComponentPath; }
1934 
1938  ComponentPath & operator+=(Component const & in_component);
1939 
1943  ComponentPath & operator+=(ComponentPath const & in_path);
1944 
1948  ComponentPath & operator+=(ComponentArray const & in_components);
1949 
1953  ComponentPath & Append(Component const & in_component);
1954 
1958  ComponentPath & Append(ComponentPath const & in_path);
1959 
1963  ComponentPath & Append(ComponentArray const & in_components);
1964 
1968  ComponentPath & operator=(ComponentPath const & in_that);
1969 
1973  ComponentPath & operator=(ComponentArray const & in_path);
1974 
1977  void Set(ComponentPath const & in_that);
1978 
1982  bool Equals(ComponentPath const & in_that) const;
1983 
1987  bool operator!= (ComponentPath const & in_that) const;
1988 
1992  bool operator== (ComponentPath const & in_that) const;
1993 
1994 
1998  ComponentPath & SetComponents(ComponentArray const & in_components);
1999 
2004  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
2005 
2008  ComponentArray GetComponents() const;
2009 
2013  KeyPathArray GetKeyPaths() const;
2014 
2019  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
2020 
2021 
2025  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
2026 
2031  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
2032 
2036  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2037 
2042  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2043 
2044 
2048  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2049 
2053  void Show(Canvas const & in_canvas, size_t in_layer = 0);
2054 
2060  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
2061 
2065  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
2066 
2067  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0);
2068 };
2069 
2070 
2075 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2076 {
2077  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2078 }
2079 
2084 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2085 {
2086  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2087 }
2088 
2093 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2094 {
2095  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2096 }
2097 
2102 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2103 {
2104  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2105 }
2106 
2111 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2112 {
2113  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2114 }
2115 
2120 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2121 {
2122  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2123 }
2124 
2129 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2130 {
2131  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2132 }
2133 
2138 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2139 {
2140  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2141 }
2142 
2147 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2148 {
2149  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2150 }
2151 
2152 
2154 class SPRK_API ComponentHighlightEvent : public Event
2155 {
2156 public:
2157  enum class Action
2158  {
2159  None = 0,
2160  Highlight,
2161  Unhighlight,
2162  };
2163 
2166  {
2167  channel = GetClassID();
2168  consumable = false;
2169  action = Action::None;
2170  }
2171 
2172  ComponentHighlightEvent(Action in_action,
2173  ComponentPath const & in_path = ComponentPath(),
2174  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2175  : Event(), action(in_action), path(in_path), options(in_options)
2176  {
2177  channel = GetClassID();
2178  consumable = false;
2179  }
2180 
2183  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2184  {
2185  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2186  {
2187  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2188  action = that.action;
2189  path = that.path;
2190  options = that.options;
2191  }
2192  else
2193  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2194  }
2195 
2197 
2200  Event * Clone() const
2201  {
2202  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2203  return new_event;
2204  }
2205 
2206  Action action;
2207  ComponentPath path;
2208  HighlightOptionsKit options;
2209 };
2210 
2211 
2213 class SPRK_API Filter : public Component
2214 {
2215 public:
2217  Filter();
2218 
2222  Filter(Component const & in_that);
2223 
2226  Filter(Filter const & in_that);
2227 
2230  Filter(Filter && in_that);
2231 
2232  virtual ~Filter();
2233 
2234  HPS::Type ObjectType() const { return HPS::Type::Filter; }
2235 
2236 
2237 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2238  Filter & operator=(Filter const & in_that) = default;
2239 #endif
2240 
2244  Filter & operator=(Filter && in_that);
2245 
2246 
2249  void Activate(View const & in_view);
2250 
2253  void Deactivate(View const & in_view);
2254 };
2255 
2256 
2257 class SPRK_API FilterActivationEvent : public Event
2258 {
2259 public:
2260  enum class Action
2261  {
2262  None = 0,
2263  Activate,
2264  Deactivate,
2265  };
2266 
2269  {
2270  channel = GetClassID();
2271  consumable = false;
2272  }
2273 
2274  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2275  {
2276  channel = GetClassID();
2277  consumable = false;
2278  }
2279 
2282  FilterActivationEvent(Event const & in_event) : Event(in_event)
2283  {
2284  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2285  {
2286  auto that = static_cast<FilterActivationEvent const &>(in_event);
2287  filter = that.filter;
2288  action = that.action;
2289  view = that.view;
2290  }
2291  else
2292  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2293  }
2294 
2296 
2299  Event * Clone() const
2300  {
2301  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2302  return new_event;
2303  }
2304 
2305  Filter filter;
2306  Action action;
2307  View view;
2308 };
2309 
2310 
2312 class SPRK_API Capture : public Component
2313 {
2314 public:
2316  Capture();
2317 
2321  Capture(Component const & in_that);
2322 
2325  Capture(Capture const & in_that);
2326 
2329  Capture(Capture && in_that);
2330 
2331  virtual ~Capture();
2332 
2333  HPS::Type ObjectType() const { return HPS::Type::Capture; }
2334 
2335 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2336  Capture & operator=(Capture const & in_that) = default;
2337 #endif
2338 
2342  Capture & operator=(Capture && in_that);
2343 
2344 
2348  View Activate();
2349 };
2350 
2351 
2352 class SPRK_API CaptureActivationEvent : public Event
2353 {
2354 public:
2357  {
2358  channel = GetClassID();
2359  consumable = false;
2360  }
2361 
2362  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2363  {
2364  channel = GetClassID();
2365  consumable = false;
2366  }
2367 
2370  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2371  {
2372  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2373  {
2374  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2375  capture = that.capture;
2376  view = that.view;
2377  }
2378  else
2379  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2380  }
2381 
2383 
2386  Event * Clone() const
2387  {
2388  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2389  return new_event;
2390  }
2391 
2392  Capture capture;
2393  View view;
2394 };
2395 
2396 
2398 class SPRK_API CADModel : public Component
2399 {
2400 public:
2402  CADModel();
2403 
2407  CADModel(Component const & in_that);
2408 
2411  CADModel(CADModel const & in_that);
2412 
2415  CADModel(CADModel && in_that);
2416 
2419  CADModel(Model const & in_that);
2420 
2421  virtual ~CADModel();
2422 
2423  HPS::Type ObjectType() const { return HPS::Type::CADModel; }
2424 
2425 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2426  CADModel & operator=(CADModel const & in_that) = default;
2427 #endif
2428 
2432  CADModel & operator=(CADModel && in_that);
2433 
2434 
2438  Component GetComponentFromKey(Key const & in_key) const;
2439 
2444  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2445 
2451  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2452 
2453 
2456  Model GetModel() const;
2457 
2460  FilterArray GetAllFilters() const;
2461 
2464  CaptureArray GetAllCaptures() const;
2465 
2469  FilterArray GetActiveFilters(View const & in_view) const;
2470 
2471 
2475  View ActivateDefaultCapture();
2476 
2477 
2485  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2486 };
2487 
2488 
2489 
2492 class SPRK_API Metadata : public Sprocket
2493 {
2494 public:
2496  Metadata();
2497 
2500  Metadata(Metadata const & in_that);
2501 
2504  Metadata(Metadata && in_that);
2505 
2508  Metadata(char const * in_name);
2509 
2510  virtual ~Metadata();
2511 
2512  HPS::Type ObjectType() const { return HPS::Type::Metadata; }
2513 
2514 
2518  Metadata & operator=(Metadata const & in_that);
2519 
2523  Metadata & operator=(Metadata && in_that);
2524 
2528  virtual void Assign(Metadata const & in_that);
2529 
2533  bool Equals(Metadata const & in_that) const;
2534 
2538  bool operator!=(Metadata const & in_that) const;
2539 
2543  bool operator==(Metadata const & in_that) const;
2544 
2545 
2548  HPS::UTF8 GetName() const;
2549 
2552  void SetName(char const * in_name);
2553 };
2554 
2556 class SPRK_API IntegerMetadata : public Metadata
2557 {
2558 public:
2560  IntegerMetadata();
2561 
2565  IntegerMetadata(Metadata const & in_that);
2566 
2569  IntegerMetadata(IntegerMetadata const & in_that);
2570 
2573  IntegerMetadata(IntegerMetadata && in_that);
2574 
2578  IntegerMetadata(char const * in_name, int in_value);
2579 
2580  virtual ~IntegerMetadata();
2581 
2582  HPS::Type ObjectType() const { return HPS::Type::IntegerMetadata; }
2583 
2584 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2585  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2586 #endif
2587 
2591  IntegerMetadata & operator=(IntegerMetadata && in_that);
2592 
2593 
2596  int GetValue() const;
2597 
2600  void SetValue(int in_value);
2601 };
2602 
2604 class SPRK_API UnsignedIntegerMetadata : public Metadata
2605 {
2606 public:
2609 
2613  UnsignedIntegerMetadata(Metadata const & in_that);
2614 
2618 
2622 
2626  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2627 
2628  virtual ~UnsignedIntegerMetadata();
2629 
2630  HPS::Type ObjectType() const { return HPS::Type::UnsignedIntegerMetadata; }
2631 
2632 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2633  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2634 #endif
2635 
2639  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2640 
2641 
2644  unsigned int GetValue() const;
2645 
2648  void SetValue(unsigned int in_value);
2649 };
2650 
2652 class SPRK_API DoubleMetadata : public Metadata
2653 {
2654 public:
2656  DoubleMetadata();
2657 
2661  DoubleMetadata(Metadata const & in_that);
2662 
2665  DoubleMetadata(DoubleMetadata const & in_that);
2666 
2669  DoubleMetadata(DoubleMetadata && in_that);
2670 
2674  DoubleMetadata(char const * in_name, double in_value);
2675 
2676  virtual ~DoubleMetadata();
2677 
2678  HPS::Type ObjectType() const { return HPS::Type::DoubleMetadata; }
2679 
2680 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2681  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2682 #endif
2683 
2687  DoubleMetadata & operator=(DoubleMetadata && in_that);
2688 
2689 
2692  double GetValue() const;
2693 
2696  void SetValue(double in_value);
2697 };
2698 
2700 class SPRK_API StringMetadata : public Metadata
2701 {
2702 public:
2704  StringMetadata();
2705 
2709  StringMetadata(Metadata const & in_that);
2710 
2713  StringMetadata(StringMetadata const & in_that);
2714 
2717  StringMetadata(StringMetadata && in_that);
2718 
2722  StringMetadata(char const * in_name, char const * in_value);
2723 
2724  virtual ~StringMetadata();
2725 
2726  HPS::Type ObjectType() const { return HPS::Type::StringMetadata; }
2727 
2728 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2729  StringMetadata & operator=(StringMetadata const & in_that) = default;
2730 #endif
2731 
2735  StringMetadata & operator=(StringMetadata && in_that);
2736 
2737 
2740  UTF8 GetValue() const;
2741 
2744  void SetValue(char const * in_value);
2745 };
2746 
2748 class SPRK_API TimeMetadata : public Metadata
2749 {
2750 public:
2752  TimeMetadata();
2753 
2757  TimeMetadata(Metadata const & in_that);
2758 
2761  TimeMetadata(TimeMetadata const & in_that);
2762 
2765  TimeMetadata(TimeMetadata && in_that);
2766 
2770  TimeMetadata(char const * in_name, unsigned int in_value);
2771 
2772  virtual ~TimeMetadata();
2773 
2774  HPS::Type ObjectType() const { return HPS::Type::TimeMetadata; }
2775 
2776 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2777  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
2778 #endif
2779 
2783  TimeMetadata & operator=(TimeMetadata && in_that);
2784 
2785 
2788  unsigned int GetValue() const;
2789 
2792  HPS::UTF8 GetValueAsString() const;
2793 
2796  void SetValue(unsigned int in_value);
2797 };
2798 
2799 
2801 class SPRK_API BooleanMetadata : public Metadata
2802 {
2803 public:
2805  BooleanMetadata();
2806 
2810  BooleanMetadata(Metadata const & in_that);
2811 
2814  BooleanMetadata(BooleanMetadata const & in_that);
2815 
2818  BooleanMetadata(BooleanMetadata && in_that);
2819 
2823  BooleanMetadata(char const * in_name, bool in_value);
2824 
2825  virtual ~BooleanMetadata();
2826 
2827  HPS::Type ObjectType() const { return HPS::Type::BooleanMetadata; }
2828 
2829 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2830  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
2831 #endif
2832 
2836  BooleanMetadata & operator=(BooleanMetadata && in_that);
2837 
2838 
2841  bool GetValue() const;
2842 
2845  void SetValue(bool in_value);
2846 };
2847 
2848 
2849 
2851 class SPRK_API Factory : public Sprocket
2852 {
2853 public:
2854 
2857  static CanvasArray GetCanvases();
2858 
2861  static LayoutArray GetLayouts();
2862 
2865  static ViewArray GetViews();
2866 
2869  static ModelArray GetModels();
2870 
2873  static CADModelArray GetCADModels();
2874 
2880  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
2881 
2886  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
2887 
2893  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
2894 
2898  static Layout CreateLayout(char const * in_name = "");
2899 
2903  static View CreateView(char const * in_name = "");
2904 
2908  static Model CreateModel(char const * in_name = "");
2909 
2910  static Component CreateComponent(HPS::Component const & in_owner, char const * in_name = "");
2911 
2912 private:
2913  Factory() {}
2914 };
2915 
2925 class SPRK_API AxisTriadOperator : public Operator
2926 {
2927 public:
2928  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2930  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
2931 
2937  virtual bool OnMouseDown(MouseState const & in_state);
2942  virtual bool OnMouseUp(MouseState const & in_state);
2947  virtual bool OnMouseMove(MouseState const & in_state);
2948 
2953  virtual bool OnTouchDown(TouchState const & in_state);
2958  virtual bool OnTouchUp(TouchState const & in_state);
2963  virtual bool OnTouchMove(TouchState const & in_state);
2964 
2965  virtual void OnViewAttached();
2966  virtual void OnViewDetached();
2967 
2968 private:
2969 
2970  bool AxisOrbit(HPS::WindowPoint const & in_loc);
2971  void Transition(HPS::SelectionResults selection_results);
2972  void TranslatePoint(HPS::WindowPoint * point);
2973  bool IsEventRelevant(HPS::Point const & event_location);
2974 
2975  bool operator_active;
2976  HPS::WindowPoint start_point;
2977  HPS::Vector start_sphere_point;
2978  float axis_subwindow_width;
2979  float axis_subwindow_height;
2980  HPS::TouchID tracked_touch_ID;
2981  HPS::Rectangle axis_subwindow;
2982  HPS::IntRectangle axis_subwindow_offsets;
2983  HPS::SegmentKey axis_triad_segment;
2984 
2985 };
2986 
2989 {
2990 public:
2993  virtual ~SmoothTransitionCompleteEvent();
2994 
2997  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
2998  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
2999 
3002  SmoothTransitionCompleteEvent(Event const & in_event) : Event(in_event)
3003  {
3004  if (in_event.GetChannel() == Object::ClassID<SmoothTransitionCompleteEvent>())
3005  {
3006  auto that = static_cast<SmoothTransitionCompleteEvent const &>(in_event);
3007  view = that.view;
3008  }
3009  else
3010  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3011  }
3012 
3015  Event * Clone() const
3016  {
3018  return new_event;
3019  }
3020 
3024  virtual bool Drop(Event const * in_that_event) const
3025  {
3026  HPS_UNREFERENCED(in_that_event);
3027  return false;
3028  }
3029 
3030  HPS::View view;
3031 };
3032 
3042 class SPRK_API NavigationCubeOperator : public Operator
3043 {
3044 public:
3045  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3046  ~NavigationCubeOperator() { OnViewDetached(); }
3047 
3049  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3050 
3055  virtual bool OnMouseDown(MouseState const & in_state);
3060  virtual bool OnMouseUp(MouseState const & in_state);
3065  virtual bool OnMouseMove(MouseState const & in_state);
3066 
3070  virtual bool OnTouchDown(TouchState const & in_state);
3075  virtual bool OnTouchUp(TouchState const & in_state);
3080  virtual bool OnTouchMove(TouchState const & in_state);
3081 
3082  virtual void OnViewAttached();
3083  virtual void OnViewDetached();
3084 
3085  virtual void OnModelAttached();
3086 
3087  void UpdateHighlightColor();
3088 
3092  void SetReferenceSegment(HPS::SegmentKey const & in_segment);
3093 
3098  void SetReferenceSegment(HPS::SegmentKeyArray const & in_segments);
3099 
3103  HPS::SegmentKeyArray ShowReferenceSegment();
3104 
3105 private:
3106  void Transition(HPS::SelectionResults selection_results);
3107  bool Orbit(HPS::WindowPoint const & in_loc);
3108  void TranslatePoint(HPS::WindowPoint * point);
3109  bool IsEventRelevant(HPS::Point const & event_location);
3110  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3111 
3112  bool operator_active;
3113  HPS::TouchID tracked_touch_ID;
3114  HPS::WindowPoint start_point;
3115  HPS::WindowPoint down_position;
3116  HPS::Vector start_sphere_point;
3117  HPS::SegmentKeyArray reference_segments; //rotation and zooming happen around these segments
3118 
3119  HPS::SegmentKey nav_cube_segment;
3120  HPS::SegmentKey style_segment;
3121  HPS::PortfolioKey portfolio;
3122  HPS::ReferenceKeyArrayArray groups;
3123  HPS::HighlightOptionsKit highlight_options_kit;
3124  HPS::CameraKit previous_camera;
3125  int previous_face;
3126  bool suppress_mouse_over_highlights;
3127 
3128  HPS::Rectangle nav_cube_subwindow;
3129  HPS::IntRectangle nav_cube_subwindow_offsets;
3130  float nav_cube_subwindow_width;
3131  float nav_cube_subwindow_height;
3132 
3133  int highlighted_group;
3134 
3135  bool moving;
3136 
3137  class SmoothTransitionCompleteEventHandler : public EventHandler
3138  {
3139  public:
3140  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3141  : handler_view(in_view), handler_moving(&in_moving) {}
3142 
3143  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3144 
3145  virtual HandleResult Handle(HPS::Event const * in_event);
3146 
3147  private:
3148  View handler_view;
3149  bool * handler_moving;
3150  };
3151 
3152  SmoothTransitionCompleteEventHandler * handler;
3153 };
3154 
3155 
3156 
3157 
3158 class SceneTreeItem;
3159 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3160 class SceneTree;
3161 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3162 
3165 class SPRK_API SceneTree : public Sprocket
3166 {
3167 public:
3170  enum class ItemType : uint32_t
3171  {
3172  None = 0x00000000,
3173  GenericMask = 0xffff0000,
3174 
3175  Segment = 0x00000001,
3176  Include = 0x00000002,
3177  ConditionalExpression = 0x00000003,
3178  StaticModelSegment = 0x00000004,
3179  AttributeFilter = 0x00000005,
3180 
3181  Geometry = 0x00010000,
3182  CuttingSection = 0x00010001,
3183  Shell = 0x00010002,
3184  Mesh = 0x00010003,
3185  Grid = 0x00010004,
3186  NURBSSurface = 0x00010005,
3187  Cylinder = 0x00010006,
3188  Sphere = 0x00010007,
3189  Polygon = 0x00010008,
3190  Circle = 0x00010009,
3191  CircularWedge = 0x0001000a,
3192  Ellipse = 0x0001000b,
3193  Line = 0x0001000c,
3194  NURBSCurve = 0x0001000d,
3195  CircularArc = 0x0001000e,
3196  EllipticalArc = 0x0001000f,
3197  InfiniteLine = 0x00010010,
3198  InfiniteRay = 0x00010011,
3199  Marker = 0x00010012,
3200  Text = 0x00010013,
3201  Reference = 0x00010014,
3202  DistantLight = 0x00010015,
3203  Spotlight = 0x00010016,
3204 
3205  Attribute = 0x00020000,
3206  Portfolio = 0x00020001,
3207  SegmentStyle = 0x00020002,
3208  NamedStyle = 0x00020003,
3209  MaterialPalette = 0x00020004,
3210  Priority = 0x00020005,
3211  Material = 0x00020006,
3212  Camera = 0x00020007,
3213  ModellingMatrix = 0x00020008,
3214  UserData = 0x00020009,
3215  TextureMatrix = 0x0002000a,
3216  Culling = 0x0002000b,
3217  CurveAttribute = 0x0002000c,
3218  CylinderAttribute = 0x0002000d,
3219  EdgeAttribute = 0x0002000e,
3220  LightingAttribute = 0x0002000f,
3221  LineAttribute = 0x00020010,
3222  MarkerAttribute = 0x00020011,
3223  SurfaceAttribute = 0x00020012,
3224  Selectability = 0x00020013,
3225  SphereAttribute = 0x00020014,
3226  Subwindow = 0x00020015,
3227  TextAttribute = 0x00020016,
3228  Transparency = 0x00020017,
3229  Visibility = 0x00020018,
3230  VisualEffects = 0x00020019,
3231  Performance = 0x00020020,
3232  DrawingAttribute = 0x00020021,
3233  HiddenLineAttribute = 0x00020022,
3234  ContourLine = 0x00020023,
3235  Condition = 0x00020024,
3236  Bounding = 0x00020025,
3237  AttributeLock = 0x00020026,
3238  TransformMask = 0x00020027,
3239  ColorInterpolation = 0x00020028,
3240  CuttingSectionAttribute = 0x00020029,
3241 
3242  // window only attributes
3243  Debugging = 0x00020030,
3244  PostProcessEffects = 0x00020031,
3245  SelectionOptions = 0x00020032,
3246  UpdateOptions = 0x00020033,
3247 
3248  Definition = 0x00040000,
3249  NamedStyleDefinition = 0x00040001,
3250  TextureDefinition = 0x00040002,
3251  LinePatternDefinition = 0x00040003,
3252  GlyphDefinition = 0x00040004,
3253  CubeMapDefinition = 0x00040005,
3254  ImageDefinition = 0x00040006,
3255  MaterialPaletteDefinition = 0x00040007,
3256  ShaderDefinition = 0x00040008,
3257  ShapeDefinition = 0x00040009,
3258 
3259  Group = 0x00080000,
3260  SegmentGroup = 0x00080100,
3261  GeometryGroup = 0x00080200,
3262  AttributeGroup = 0x00080300,
3263  PortfolioGroup = 0x00080400,
3264  StyleGroup = 0x00080500,
3265  IncludeGroup = 0x00080600,
3266  DefinitionGroup = 0x00180000,
3267  NamedStyleDefinitionGroup = 0x00180700,
3268  TextureDefinitionGroup = 0x00180800,
3269  LinePatternDefinitionGroup = 0x00180900,
3270  GlyphDefinitionGroup = 0x00180a00,
3271  CubeMapDefinitionGroup = 0x00180b00,
3272  ImageDefinitionGroup = 0x00180c00,
3273  MaterialPaletteDefinitionGroup = 0x00180d00,
3274  ShaderDefinitionGroup = 0x00180e00,
3275  ShapeDefinitionGroup = 0x00180f00,
3276  CuttingSectionGroup = 0x00080001,
3277  ShellGroup = 0x00080002,
3278  MeshGroup = 0x00080003,
3279  GridGroup = 0x00080004,
3280  NURBSSurfaceGroup = 0x00080005,
3281  CylinderGroup = 0x00080006,
3282  SphereGroup = 0x00080007,
3283  PolygonGroup = 0x00080008,
3284  CircleGroup = 0x00080009,
3285  CircularWedgeGroup = 0x0008000a,
3286  EllipseGroup = 0x0008000b,
3287  LineGroup = 0x0008000c,
3288  NURBSCurveGroup = 0x0008000d,
3289  CircularArcGroup = 0x0008000e,
3290  EllipticalArcGroup = 0x0008000f,
3291  InfiniteLineGroup = 0x00080010,
3292  InfiniteRayGroup = 0x00080011,
3293  MarkerGroup = 0x00080012,
3294  TextGroup = 0x00080013,
3295  ReferenceGroup = 0x00080014,
3296  DistantLightGroup = 0x00080015,
3297  SpotlightGroup = 0x00080016,
3298  };
3299 
3301  SceneTree();
3302 
3305  SceneTree(Canvas const & in_canvas);
3306 
3309  SceneTree(SceneTree const & in_that);
3310 
3313  SceneTree(SceneTree && in_that);
3314 
3315  virtual ~SceneTree();
3316 
3317  virtual HPS::Type ObjectType() const { return HPS::Type::SceneTree; }
3318 
3322  SceneTree & operator=(SceneTree const & in_that);
3323 
3327  SceneTree & operator=(SceneTree && in_that);
3328 
3332  virtual void Assign(SceneTree const & in_that);
3333 
3337  bool Equals(SceneTree const & in_that) const;
3338 
3342  bool operator!=(SceneTree const & in_that) const;
3343 
3347  bool operator==(SceneTree const & in_that) const;
3348 
3349 
3358  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3359 
3369  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3370 
3381  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3382 
3390  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3391 
3394  HighlightOptionsKitArray GetHighlightOptions() const;
3395 
3396 
3401  void SetGroupingLimit(size_t in_limit);
3402 
3405  size_t GetGroupingLimit() const;
3406 
3407 
3414  void SetRoot(SceneTreeItemPtr const & in_root);
3415 
3418  SceneTreeItemPtr GetRoot() const;
3419 
3420 
3423  virtual void Flush();
3424 
3429  void SetHighlightEventHandling(bool in_state);
3430 
3434  bool GetHighlightEventHandling() const;
3435 
3438  void ReExpand();
3439 };
3440 
3441 
3444 class SPRK_API SceneTreeItem : public Sprocket
3445 {
3446 public:
3448  SceneTreeItem();
3449 
3452  SceneTreeItem(SceneTreeItem const & in_that);
3453 
3456  SceneTreeItem(SceneTreeItem && in_that);
3457 
3463  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3464 
3470  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3471 
3477  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3478 
3484  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3485 
3493  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3494 
3495  virtual ~SceneTreeItem();
3496 
3497  HPS::Type ObjectType() const { return HPS::Type::SceneTreeItem; }
3498 
3502  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3503 
3507  SceneTreeItem & operator=(SceneTreeItem && in_that);
3508 
3512  virtual void Assign(SceneTreeItem const & in_that);
3513 
3517  bool Equals(SceneTreeItem const & in_that) const;
3518 
3522  bool operator!=(SceneTreeItem const & in_that) const;
3523 
3527  bool operator==(SceneTreeItem const & in_that) const;
3528 
3529 
3532  SceneTreePtr GetTree() const;
3533 
3536  UTF8 GetTitle() const;
3537 
3540  SceneTree::ItemType GetItemType() const;
3541 
3545  bool HasItemType(SceneTree::ItemType in_mask) const;
3546 
3549  Key GetKey() const;
3550 
3553  KeyPath GetKeyPath() const;
3554 
3557  bool HasChildren() const;
3558 
3559 
3568  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3569 
3570 
3573  virtual void Expand();
3574 
3577  virtual void Collapse();
3578 
3579 
3584  bool IsSelected() const;
3585 
3591  virtual void Select();
3592 
3598  virtual void Unselect();
3599 
3604  bool IsHighlightable() const;
3605 
3611  bool IsHighlighted() const;
3612 
3617  void Highlight(size_t in_highlight_options_index = 0);
3618 
3624  void Highlight(HighlightOptionsKit const & in_highlight_options);
3625 
3631  void Unhighlight(size_t in_highlight_options_index = 0);
3632 
3639  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3640 
3643  bool IsExpanded() const;
3644 
3647  void ReExpand();
3648 };
3649 
3650 
3651 
3652 class ComponentTreeItem;
3653 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3654 class ComponentTree;
3655 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3656 
3659 class SPRK_API ComponentTree : public Sprocket
3660 {
3661 public:
3664  enum class ItemType
3665  {
3666  None,
3667  ExchangeComponent,
3668  ExchangeModelFile,
3669 
3670  ExchangeViewGroup,
3671  ExchangeAnnotationViewGroup,
3672  ExchangePMIGroup,
3673  ExchangeModelGroup,
3674 
3675  ParasolidComponent,
3676  ParasolidModelFile,
3677 
3678  DWGComponent,
3679  DWGModelFile,
3680  };
3681 
3683  ComponentTree();
3684 
3688  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3689 
3692  ComponentTree(ComponentTree const & in_that);
3693 
3696  ComponentTree(ComponentTree && in_that);
3697 
3698  virtual ~ComponentTree();
3699 
3700  virtual HPS::Type ObjectType() const { return HPS::Type::ComponentTree; }
3701 
3705  ComponentTree & operator=(ComponentTree const & in_that);
3706 
3710  ComponentTree & operator=(ComponentTree && in_that);
3711 
3715  virtual void Assign(ComponentTree const & in_that);
3716 
3720  bool Equals(ComponentTree const & in_that) const;
3721 
3725  bool operator!=(ComponentTree const & in_that) const;
3726 
3730  bool operator==(ComponentTree const & in_that) const;
3731 
3732 
3741  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3742 
3752  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3753 
3764  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3765 
3775  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3776 
3779  HighlightOptionsKitArray GetHighlightOptions() const;
3780 
3781 
3788  void SetRoot(ComponentTreeItemPtr const & in_root);
3789 
3792  ComponentTreeItemPtr GetRoot() const;
3793 
3794 
3797  virtual void Flush();
3798 
3801  void ReExpand();
3802 
3807  void SetHighlightEventHandling(bool in_state);
3808 
3812  bool GetHighlightEventHandling() const;
3813 };
3814 
3815 
3818 class SPRK_API ComponentTreeItem : public Sprocket
3819 {
3820 public:
3823 
3826  ComponentTreeItem(ComponentTreeItem const & in_that);
3827 
3831 
3837  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
3838 
3845  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
3846 
3847  virtual ~ComponentTreeItem();
3848 
3849  HPS::Type ObjectType() const { return HPS::Type::ComponentTreeItem; }
3850 
3854  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
3855 
3859  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
3860 
3864  virtual void Assign(ComponentTreeItem const & in_that);
3865 
3869  bool Equals(ComponentTreeItem const & in_that) const;
3870 
3874  bool operator!=(ComponentTreeItem const & in_that) const;
3875 
3879  bool operator==(ComponentTreeItem const & in_that) const;
3880 
3881 
3882 
3885  ComponentTreePtr GetTree() const;
3886 
3889  UTF8 GetTitle() const;
3890 
3893  ComponentTree::ItemType GetItemType() const;
3894 
3897  Component GetComponent() const;
3898 
3901  bool HasChildren() const;
3902 
3905  ComponentPath GetPath() const;
3906 
3907 
3915  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
3916 
3917 
3920  virtual void Expand();
3921 
3924  virtual void Collapse();
3925 
3926 
3932  bool IsHighlighted() const;
3933 
3938  virtual void OnHighlight(HighlightOptionsKit const & in_options);
3939 
3944  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
3945 
3946 
3951  void Highlight(size_t in_highlight_options_index = 0);
3952 
3958  void Highlight(HighlightOptionsKit const & in_highlight_options);
3959 
3964  void Unhighlight(size_t in_highlight_options_index = 0);
3965 
3971  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3972 
3973 
3983  bool IsHidden() const;
3984 
3988  virtual void OnHide();
3989 
3993  virtual void OnShow();
3994 
3998  void Hide();
3999 
4003  void Show();
4004 
4009  void Isolate();
4010 
4013  bool IsExpanded() const;
4014 
4017  void ReExpand();
4018 };
4019 
4020 
4021 
4022 
4023 }
4024 #endif
4025 
4026 
4027 
Definition: sprk.h:2748
HPS::Type ObjectType() const
Definition: sprk.h:2582
Definition: hps.h:3355
Definition: hps.h:6171
Definition: sprk.h:964
HPS::Type ObjectType() const
Definition: sprk.h:452
Event * Clone() const
Definition: sprk.h:717
Definition: sprk.h:2925
Definition: sprk.h:237
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2183
HPS::Type ObjectType() const
Definition: sprk.h:245
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1161
Definition: hps.h:40174
ComponentHighlightEvent()
Definition: sprk.h:2165
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1187
Definition: hps.h:474
CameraChangedEvent(Event const &in_event)
Definition: sprk.h:983
HPS::Type ObjectType() const
Definition: sprk.h:210
HPS::Type ObjectType() const
Definition: sprk.h:1073
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1146
HPS::Type ObjectType() const
Definition: sprk.h:2234
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5680
Location
Definition: sprk.h:1357
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1190
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1151
ItemType
Definition: sprk.h:3664
Definition: hps.h:5720
virtual intptr_t Freshen() const
Definition: sprk.h:1006
CaptureActivationEvent()
Definition: sprk.h:2356
Definition: sprk.h:66
Definition: sprk.h:207
Definition: sprk.h:639
Definition: sprk.h:100
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1111
Definition: sprk.h:3818
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1121
Definition: sprk.h:2801
HPS::Type ObjectType() const
Definition: sprk.h:2423
Definition: hps.h:39961
Definition: hps.h:1313
Definition: hps.h:1031
HPS::Type ObjectType() const
Definition: sprk.h:1933
Definition: hps.h:1663
ModelDeletedEvent()
Definition: sprk.h:925
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:2997
Definition: sprk.h:3659
Definition: hps.h:44747
Definition: sprk.h:1024
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1136
Definition: hps.h:7680
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1182
virtual HPS::Type ObjectType() const
Definition: sprk.h:3317
Definition: hps.h:3506
Definition: hps.h:2017
Definition: sprk.h:876
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:761
Definition: sprk.h:727
Definition: hps.h:1381
Definition: hps.h:852
HPS::Type ObjectType() const
Definition: sprk.h:1531
Definition: hps.h:40079
virtual void OnModelDetached()
Definition: sprk.h:1175
SmoothTransitionCompleteEvent(Event const &in_event)
Definition: sprk.h:3002
Definition: hps.h:1710
Definition: hps.h:1501
Definition: hps.h:8847
Definition: hps.h:248
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1178
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1770
Event * Clone() const
Definition: sprk.h:867
CameraChangedEvent()
Definition: sprk.h:968
Definition: hps.h:44646
Definition: hps.h:39051
Definition: sprk.h:1353
Definition: sprk.h:921
Definition: sprk.h:524
HPS::Type ObjectType() const
Definition: sprk.h:107
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:803
virtual void OnViewDetached()
Definition: sprk.h:1167
Definition: hps.h:39097
HPS::Type ObjectType() const
Definition: sprk.h:3497
LayoutDeletedEvent()
Definition: sprk.h:731
Event * Clone() const
Definition: sprk.h:911
virtual void OnViewAttached()
Definition: sprk.h:1164
Definition: hps.h:38485
Definition: hps.h:41506
Definition: hps.h:1071
Definition: sprk.h:2492
LayoutDetachedEvent()
Definition: sprk.h:686
Definition: sprk.h:2604
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1126
Definition: hps.h:9622
Definition: hps.h:40122
Definition: hps.h:1460
SmoothTransitionCompleteEvent()
Definition: sprk.h:2992
Definition: hps.h:1401
HPS::Type ObjectType() const
Definition: sprk.h:531
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1106
FilterActivationEvent()
Definition: sprk.h:2268
Definition: hps.h:1420
virtual void OnModelAttached()
Definition: sprk.h:1171
Definition: hps.h:36354
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2282
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:895
HPS::Type ObjectType() const
Definition: sprk.h:1385
HPS::Type ObjectType() const
Definition: sprk.h:1746
Definition: hps.h:7053
Location
Definition: sprk.h:1503
Definition: hps.h:44138
Definition: sprk.h:2556
Definition: sprk.h:1499
Definition: hps.h:41683
HPS::Type ObjectType() const
Definition: sprk.h:1232
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:227
Definition: hps.h:43191
virtual UTF8 GetName() const
Definition: sprk.h:1096
Definition: hps.h:44534
Definition: sprk.h:682
Event * Clone() const
Definition: sprk.h:2299
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2370
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1131
HPS::Type ObjectType() const
Definition: sprk.h:2678
CanvasDeletedEvent()
Definition: sprk.h:643
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1116
HPS::Type ObjectType() const
Definition: sprk.h:2512
HPS::Type ObjectType() const
Definition: sprk.h:2630
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:222
Event * Clone() const
Definition: sprk.h:2386
UpdateType
Definition: hps.h:182
Definition: hps.h:15084
ViewDeletedEvent()
Definition: sprk.h:837
intptr_t GetChannel() const
Definition: hps.h:6304
Definition: sprk.h:770
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:3024
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2930
Definition: sprk.h:1636
Definition: hps.h:41960
Definition: hps.h:43803
virtual bool OnTextInput(HPS::UTF8 const &in_text)
Definition: sprk.h:1156
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:852
Definition: hps.h:35940
Definition: sprk.h:2700
ViewDetachedEvent()
Definition: sprk.h:781
Definition: hps.h:6271
Definition: sprk.h:1210
Definition: hps.h:410
HPS::Type ObjectType() const
Definition: sprk.h:2726
Event * Clone() const
Definition: sprk.h:2200
Definition: sprk.h:445
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:658
Definition: sprk.h:3042
Definition: sprk.h:1902
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:996
ComponentType
Definition: sprk.h:1641
Definition: hps.h:43117
Definition: hps.h:2036
Definition: sprk.h:2154
Event * Clone() const
Definition: sprk.h:673
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:701
HPS::Type ObjectType() const
Definition: sprk.h:3849
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1101
ItemType
Definition: sprk.h:3170
Definition: sprk.h:2213
Definition: sprk.h:2851
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3049
Definition: sprk.h:184
Definition: sprk.h:2988
Definition: hps.h:429
Event * Clone() const
Definition: sprk.h:955
Definition: sprk.h:2312
Definition: hps.h:2056
ModelDetachedEvent()
Definition: sprk.h:880
static MouseButtons ButtonLeft()
Definition: hps.h:44256
virtual HPS::Type ObjectType() const
Definition: sprk.h:3700
Definition: sprk.h:3165
Definition: sprk.h:2652
Definition: hps.h:8965
HPS::Type ObjectType() const
Definition: sprk.h:1034
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1193
Definition: hps.h:7599
Definition: sprk.h:2257
Definition: hps.h:35556
Definition: hps.h:355
Event * Clone() const
Definition: sprk.h:3015
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:940
Event * Clone() const
Definition: sprk.h:821
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:746
Definition: hps.h:9179
Definition: hps.h:10687
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1141
Definition: sprk.h:3444
Definition: sprk.h:2398
Definition: hps.h:40648
Mode
Definition: sprk.h:189
Definition: hps.h:515
Definition: sprk.h:1065
Definition: hps.h:1114
Definition: hps.h:40006
Definition: sprk.h:833
Definition: sprk.h:2352
Definition: hps.h:38548
HPS::Type ObjectType() const
Definition: sprk.h:2774
HPS::Type ObjectType() const
Definition: sprk.h:2333
HPS::Type ObjectType() const
Definition: sprk.h:2827
Definition: hps.h:7311
Event * Clone() const
Definition: sprk.h:1013