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 
1396  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1397 
1400  Location GetLocation() const;
1401 
1405  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1406 
1409  HPS::Rectangle GetPosition() const;
1410 
1415  NavigationCubeControl & SetVisibility(bool in_visibility);
1416 
1419  bool GetVisibility() const;
1420 
1424  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1425 
1428  bool GetTextVisibility() const;
1429 
1444  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1445 
1448  HPS::UTF8 GetMaterialPalette() const;
1449 
1457  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1458 
1459 
1462  bool GetInteractivity() const;
1463 
1468  NavigationCubeControl & SetSize(float in_size);
1469 
1472  float GetSize() const;
1473 
1476  HPS::SegmentKey GetSegmentKey() const;
1477 
1478 private:
1481 
1483  HPS::SegmentKey GetNavigationCubeSegment() const;
1484 };
1485 
1488 class SPRK_API AxisTriadControl : public SprocketControl
1489 {
1490 public:
1491 
1492  enum class Location
1493  {
1494  TopRight,
1495  TopLeft,
1496  BottomRight,
1497  BottomLeft,
1498  Custom,
1499  };
1500 
1502  explicit AxisTriadControl(View const & in_view);
1503 
1505  AxisTriadControl(AxisTriadControl const & in_that);
1506 
1510  AxisTriadControl(AxisTriadControl && in_that);
1511 
1515  AxisTriadControl & operator=(AxisTriadControl && in_that);
1516 
1518  ~AxisTriadControl();
1519 
1520  HPS::Type ObjectType() const {return HPS::Type::AxisTriadControl;};
1521 
1523  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1524 
1531  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1532 
1535  Location GetLocation() const;
1536 
1540  AxisTriadControl & SetPosition(HPS::Rectangle const & in_rectangle);
1541 
1544  HPS::Rectangle GetPosition() const;
1545 
1550  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1551 
1554  bool GetVisibility() const;
1555 
1559  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1560 
1563  bool GetTextVisibility() const;
1564 
1573  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1574 
1577  HPS::UTF8 GetMaterialPalette() const;
1578 
1585  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1586 
1589  bool GetInteractivity() const;
1590 
1595  AxisTriadControl & SetSize(float in_size);
1596 
1599  float GetSize() const;
1600 
1603  HPS::SegmentKey GetSegmentKey() const;
1604 
1605 private:
1607  AxisTriadControl(){};
1608 
1610  HPS::SegmentKey GetAxisTriadSegment() const;
1611 };
1612 
1614 class SPRK_API Component : public Sprocket
1615 {
1616 public:
1619  enum class ComponentType : uint32_t
1620  {
1621  None = 0x00000000,
1622  GenericMask = 0xfffff000,
1623 
1624  ExchangeComponentMask = 0x00001000,
1625  ExchangeModelFile = 0x00001001,
1626  ExchangeProductOccurrence = 0x00001002,
1627  ExchangePartDefinition = 0x00001003,
1628 
1629  ExchangeView = 0x00001004,
1630  ExchangeFilter = 0x00001005,
1631 
1632  ExchangeRepresentationItemMask = 0x00003000,
1633  ExchangeRIBRepModel = 0x00003001,
1634  ExchangeRICurve = 0x00003002,
1635  ExchangeRIDirection = 0x00003003,
1636  ExchangeRIPlane = 0x00003004,
1637  ExchangeRIPointSet = 0x00003005,
1638  ExchangeRIPolyBRepModel = 0x00003006,
1639  ExchangeRIPolyWire = 0x00003007,
1640  ExchangeRISet = 0x00003008,
1641  ExchangeRICoordinateSystem = 0x00003009,
1642 
1643  ExchangeTopologyMask = 0x00005000,
1644  ExchangeTopoBody = 0x00005001,
1645  ExchangeTopoConnex = 0x00005002,
1646  ExchangeTopoShell = 0x00005003,
1647  ExchangeTopoFace = 0x00005004,
1648  ExchangeTopoLoop = 0x00005005,
1649  ExchangeTopoCoEdge = 0x00005006,
1650  ExchangeTopoEdge = 0x00005007,
1651  ExchangeTopoVertex = 0x00005008,
1652  ExchangeTopoSingleWireBody = 0x00005009,
1653  ExchangeTopoWireEdge = 0x0000500a,
1654 
1655  ExchangeDrawingMask = 0x00009000,
1656  ExchangeDrawingModel = 0x00009001,
1657  ExchangeDrawingView = 0x00009002,
1658  ExchangeDrawingSheet = 0x00009003,
1659  ExchangeBasicDrawingBlock = 0x00009004,
1660  ExchangeOperatorDrawingBlock = 0x00009005,
1661 
1662  ExchangePMIMask = 0x00011000,
1663  ExchangePMI = ExchangePMIMask,
1664  ExchangePMIText = 0x00011100,
1665  ExchangePMIRichText = 0x00011200,
1666  ExchangePMIRoughness = 0x00011300,
1667  ExchangePMIGDT = 0x00011400,
1668  ExchangePMIDatum = 0x00011500,
1669  ExchangePMILineWelding = 0x00011600,
1670  ExchangePMISpotWelding = 0x00011700,
1671  ExchangePMIDimension = 0x00011800,
1672  ExchangePMIBalloon = 0x00011900,
1673  ExchangePMICoordinate = 0x00011a00,
1674  ExchangePMIFastener = 0x00011b00,
1675  ExchangePMILocator = 0x00011c00,
1676  ExchangePMIMeasurementPoint = 0x00011d00,
1677 
1678 
1679  ParasolidComponentMask = 0x00020000,
1680 
1681  ParasolidModelFile = 0x00020001,
1682  ParasolidAssembly = 0x00020002,
1683  ParasolidInstance = 0x00020003,
1684 
1685  ParasolidTopologyMask = 0x00060000,
1686  ParasolidTopoBody = 0x00060001,
1687  ParasolidTopoRegion = 0x00060002,
1688  ParasolidTopoShell = 0x00060003,
1689  ParasolidTopoFace = 0x00060004,
1690  ParasolidTopoLoop = 0x00060005,
1691  ParasolidTopoFin = 0x00060006,
1692  ParasolidTopoEdge = 0x00060007,
1693  ParasolidTopoVertex = 0x00060008,
1694 
1695 
1696  DWGComponentMask = 0x00100000,
1697  DWGModelFile = 0x00100001,
1698  DWGLayout = 0x00100002,
1699  DWGBlockTable = 0x00100003,
1700  DWGBlockTableRecord = 0x00100004,
1701  DWGEntity = 0x00100005,
1702  DWGLayerTable = 0x00100006,
1703  DWGLayer = 0x00100007,
1704 
1705 
1706  UserComponent = 0x01000000,
1707  };
1708 
1709 
1711  Component();
1712 
1715  Component(Component const & in_that);
1716 
1719  Component(Component && in_that);
1720 
1722  virtual ~Component();
1723 
1724  HPS::Type ObjectType() const { return HPS::Type::Component; }
1725 
1726 
1730  Component & operator=(Component const & in_that);
1731 
1735  Component & operator=(Component && in_that);
1736 
1740  virtual void Assign(Component const & in_that);
1741 
1745  bool Equals(Component const & in_that) const;
1746 
1750  bool operator!=(Component const & in_that) const;
1751 
1755  bool operator==(Component const & in_that) const;
1756 
1757 
1760  ComponentType GetComponentType() const;
1761 
1765  bool HasComponentType(ComponentType in_mask) const;
1766 
1767 
1768 
1774  void AddKey(Key const & in_key);
1775 
1778  KeyArray GetKeys() const;
1779 
1780 
1781 
1786  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1787 
1791  ComponentArray GetOwners() const;
1792 
1795  ComponentArray GetSubcomponents() const;
1796 
1801  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1802 
1803 
1804 
1807  void AddReference(Component & in_reference);
1808 
1811  ComponentArray GetReferrers() const;
1812 
1816  ComponentArray GetReferences() const;
1817 
1818 
1819 
1822  MetadataArray GetAllMetadata() const;
1823 
1827  Metadata GetMetadata(char const * in_name) const;
1828 
1832  UTF8 GetName() const;
1833 
1834 
1835 
1840  void Delete();
1841 
1845  void Flush();
1846 
1847 
1855  static KeyPathArray GetKeyPath(Component const & in_component);
1856 
1866  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
1867 
1876  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
1877 };
1878 
1880 class SPRK_API ComponentPath : public Sprocket
1881 {
1882 public:
1884  ComponentPath();
1885 
1888  ComponentPath(ComponentArray const & in_components);
1889 
1893  ComponentPath(size_t in_count, Component const in_components[]);
1894 
1896  ComponentPath(ComponentPath const & in_that);
1897 
1901  ComponentPath(ComponentPath && in_that);
1902 
1906  ComponentPath & operator=(ComponentPath && in_that);
1907 
1909  virtual ~ComponentPath();
1910 
1911  HPS::Type ObjectType() const { return HPS::Type::ComponentPath; }
1912 
1916  ComponentPath & operator+=(Component const & in_component);
1917 
1921  ComponentPath & operator+=(ComponentPath const & in_path);
1922 
1926  ComponentPath & operator+=(ComponentArray const & in_components);
1927 
1931  ComponentPath & Append(Component const & in_component);
1932 
1936  ComponentPath & Append(ComponentPath const & in_path);
1937 
1941  ComponentPath & Append(ComponentArray const & in_components);
1942 
1946  ComponentPath & operator=(ComponentPath const & in_that);
1947 
1951  ComponentPath & operator=(ComponentArray const & in_path);
1952 
1955  void Set(ComponentPath const & in_that);
1956 
1960  bool Equals(ComponentPath const & in_that) const;
1961 
1965  bool operator!= (ComponentPath const & in_that) const;
1966 
1970  bool operator== (ComponentPath const & in_that) const;
1971 
1972 
1976  ComponentPath & SetComponents(ComponentArray const & in_components);
1977 
1982  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
1983 
1986  ComponentArray GetComponents() const;
1987 
1991  KeyPathArray GetKeyPaths() const;
1992 
1997  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
1998 
1999 
2003  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
2004 
2009  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
2010 
2014  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2015 
2020  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2021 
2022 
2026  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2027 
2031  void Show(Canvas const & in_canvas, size_t in_layer = 0);
2032 
2038  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
2039 
2043  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
2044 
2045  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0);
2046 };
2047 
2048 
2053 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2054 {
2055  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2056 }
2057 
2062 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2063 {
2064  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2065 }
2066 
2071 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2072 {
2073  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2074 }
2075 
2080 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2081 {
2082  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2083 }
2084 
2089 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2090 {
2091  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2092 }
2093 
2098 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2099 {
2100  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2101 }
2102 
2107 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2108 {
2109  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2110 }
2111 
2116 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2117 {
2118  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2119 }
2120 
2125 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2126 {
2127  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2128 }
2129 
2130 
2132 class SPRK_API ComponentHighlightEvent : public Event
2133 {
2134 public:
2135  enum class Action
2136  {
2137  None = 0,
2138  Highlight,
2139  Unhighlight,
2140  };
2141 
2144  {
2145  channel = GetClassID();
2146  consumable = false;
2147  action = Action::None;
2148  }
2149 
2150  ComponentHighlightEvent(Action in_action,
2151  ComponentPath const & in_path = ComponentPath(),
2152  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2153  : Event(), action(in_action), path(in_path), options(in_options)
2154  {
2155  channel = GetClassID();
2156  consumable = false;
2157  }
2158 
2161  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2162  {
2163  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2164  {
2165  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2166  action = that.action;
2167  path = that.path;
2168  options = that.options;
2169  }
2170  else
2171  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2172  }
2173 
2175 
2178  Event * Clone() const
2179  {
2180  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2181  return new_event;
2182  }
2183 
2184  Action action;
2185  ComponentPath path;
2186  HighlightOptionsKit options;
2187 };
2188 
2189 
2191 class SPRK_API Filter : public Component
2192 {
2193 public:
2195  Filter();
2196 
2200  Filter(Component const & in_that);
2201 
2204  Filter(Filter const & in_that);
2205 
2208  Filter(Filter && in_that);
2209 
2210  virtual ~Filter();
2211 
2212  HPS::Type ObjectType() const { return HPS::Type::Filter; }
2213 
2214 
2215 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2216  Filter & operator=(Filter const & in_that) = default;
2217 #endif
2218 
2222  Filter & operator=(Filter && in_that);
2223 
2224 
2227  void Activate(View const & in_view);
2228 
2231  void Deactivate(View const & in_view);
2232 };
2233 
2234 
2235 class SPRK_API FilterActivationEvent : public Event
2236 {
2237 public:
2238  enum class Action
2239  {
2240  None = 0,
2241  Activate,
2242  Deactivate,
2243  };
2244 
2247  {
2248  channel = GetClassID();
2249  consumable = false;
2250  }
2251 
2252  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2253  {
2254  channel = GetClassID();
2255  consumable = false;
2256  }
2257 
2260  FilterActivationEvent(Event const & in_event) : Event(in_event)
2261  {
2262  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2263  {
2264  auto that = static_cast<FilterActivationEvent const &>(in_event);
2265  filter = that.filter;
2266  action = that.action;
2267  view = that.view;
2268  }
2269  else
2270  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2271  }
2272 
2274 
2277  Event * Clone() const
2278  {
2279  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2280  return new_event;
2281  }
2282 
2283  Filter filter;
2284  Action action;
2285  View view;
2286 };
2287 
2288 
2290 class SPRK_API Capture : public Component
2291 {
2292 public:
2294  Capture();
2295 
2299  Capture(Component const & in_that);
2300 
2303  Capture(Capture const & in_that);
2304 
2307  Capture(Capture && in_that);
2308 
2309  virtual ~Capture();
2310 
2311  HPS::Type ObjectType() const { return HPS::Type::Capture; }
2312 
2313 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2314  Capture & operator=(Capture const & in_that) = default;
2315 #endif
2316 
2320  Capture & operator=(Capture && in_that);
2321 
2322 
2326  View Activate();
2327 };
2328 
2329 
2330 class SPRK_API CaptureActivationEvent : public Event
2331 {
2332 public:
2335  {
2336  channel = GetClassID();
2337  consumable = false;
2338  }
2339 
2340  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2341  {
2342  channel = GetClassID();
2343  consumable = false;
2344  }
2345 
2348  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2349  {
2350  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2351  {
2352  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2353  capture = that.capture;
2354  view = that.view;
2355  }
2356  else
2357  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2358  }
2359 
2361 
2364  Event * Clone() const
2365  {
2366  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2367  return new_event;
2368  }
2369 
2370  Capture capture;
2371  View view;
2372 };
2373 
2374 
2376 class SPRK_API CADModel : public Component
2377 {
2378 public:
2380  CADModel();
2381 
2385  CADModel(Component const & in_that);
2386 
2389  CADModel(CADModel const & in_that);
2390 
2393  CADModel(CADModel && in_that);
2394 
2397  CADModel(Model const & in_that);
2398 
2399  virtual ~CADModel();
2400 
2401  HPS::Type ObjectType() const { return HPS::Type::CADModel; }
2402 
2403 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2404  CADModel & operator=(CADModel const & in_that) = default;
2405 #endif
2406 
2410  CADModel & operator=(CADModel && in_that);
2411 
2412 
2416  Component GetComponentFromKey(Key const & in_key) const;
2417 
2422  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2423 
2429  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2430 
2431 
2434  Model GetModel() const;
2435 
2438  FilterArray GetAllFilters() const;
2439 
2442  CaptureArray GetAllCaptures() const;
2443 
2447  FilterArray GetActiveFilters(View const & in_view) const;
2448 
2449 
2453  View ActivateDefaultCapture();
2454 
2455 
2463  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2464 };
2465 
2466 
2467 
2470 class SPRK_API Metadata : public Sprocket
2471 {
2472 public:
2474  Metadata();
2475 
2478  Metadata(Metadata const & in_that);
2479 
2482  Metadata(Metadata && in_that);
2483 
2486  Metadata(char const * in_name);
2487 
2488  virtual ~Metadata();
2489 
2490  HPS::Type ObjectType() const { return HPS::Type::Metadata; }
2491 
2492 
2496  Metadata & operator=(Metadata const & in_that);
2497 
2501  Metadata & operator=(Metadata && in_that);
2502 
2506  virtual void Assign(Metadata const & in_that);
2507 
2511  bool Equals(Metadata const & in_that) const;
2512 
2516  bool operator!=(Metadata const & in_that) const;
2517 
2521  bool operator==(Metadata const & in_that) const;
2522 
2523 
2526  HPS::UTF8 GetName() const;
2527 
2530  void SetName(char const * in_name);
2531 };
2532 
2534 class SPRK_API IntegerMetadata : public Metadata
2535 {
2536 public:
2538  IntegerMetadata();
2539 
2543  IntegerMetadata(Metadata const & in_that);
2544 
2547  IntegerMetadata(IntegerMetadata const & in_that);
2548 
2551  IntegerMetadata(IntegerMetadata && in_that);
2552 
2556  IntegerMetadata(char const * in_name, int in_value);
2557 
2558  virtual ~IntegerMetadata();
2559 
2560  HPS::Type ObjectType() const { return HPS::Type::IntegerMetadata; }
2561 
2562 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2563  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2564 #endif
2565 
2569  IntegerMetadata & operator=(IntegerMetadata && in_that);
2570 
2571 
2574  int GetValue() const;
2575 
2578  void SetValue(int in_value);
2579 };
2580 
2582 class SPRK_API UnsignedIntegerMetadata : public Metadata
2583 {
2584 public:
2587 
2591  UnsignedIntegerMetadata(Metadata const & in_that);
2592 
2596 
2600 
2604  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2605 
2606  virtual ~UnsignedIntegerMetadata();
2607 
2608  HPS::Type ObjectType() const { return HPS::Type::UnsignedIntegerMetadata; }
2609 
2610 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2611  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2612 #endif
2613 
2617  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2618 
2619 
2622  unsigned int GetValue() const;
2623 
2626  void SetValue(unsigned int in_value);
2627 };
2628 
2630 class SPRK_API DoubleMetadata : public Metadata
2631 {
2632 public:
2634  DoubleMetadata();
2635 
2639  DoubleMetadata(Metadata const & in_that);
2640 
2643  DoubleMetadata(DoubleMetadata const & in_that);
2644 
2647  DoubleMetadata(DoubleMetadata && in_that);
2648 
2652  DoubleMetadata(char const * in_name, double in_value);
2653 
2654  virtual ~DoubleMetadata();
2655 
2656  HPS::Type ObjectType() const { return HPS::Type::DoubleMetadata; }
2657 
2658 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2659  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2660 #endif
2661 
2665  DoubleMetadata & operator=(DoubleMetadata && in_that);
2666 
2667 
2670  double GetValue() const;
2671 
2674  void SetValue(double in_value);
2675 };
2676 
2678 class SPRK_API StringMetadata : public Metadata
2679 {
2680 public:
2682  StringMetadata();
2683 
2687  StringMetadata(Metadata const & in_that);
2688 
2691  StringMetadata(StringMetadata const & in_that);
2692 
2695  StringMetadata(StringMetadata && in_that);
2696 
2700  StringMetadata(char const * in_name, char const * in_value);
2701 
2702  virtual ~StringMetadata();
2703 
2704  HPS::Type ObjectType() const { return HPS::Type::StringMetadata; }
2705 
2706 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2707  StringMetadata & operator=(StringMetadata const & in_that) = default;
2708 #endif
2709 
2713  StringMetadata & operator=(StringMetadata && in_that);
2714 
2715 
2718  UTF8 GetValue() const;
2719 
2722  void SetValue(char const * in_value);
2723 };
2724 
2726 class SPRK_API TimeMetadata : public Metadata
2727 {
2728 public:
2730  TimeMetadata();
2731 
2735  TimeMetadata(Metadata const & in_that);
2736 
2739  TimeMetadata(TimeMetadata const & in_that);
2740 
2743  TimeMetadata(TimeMetadata && in_that);
2744 
2748  TimeMetadata(char const * in_name, unsigned int in_value);
2749 
2750  virtual ~TimeMetadata();
2751 
2752  HPS::Type ObjectType() const { return HPS::Type::TimeMetadata; }
2753 
2754 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2755  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
2756 #endif
2757 
2761  TimeMetadata & operator=(TimeMetadata && in_that);
2762 
2763 
2766  unsigned int GetValue() const;
2767 
2770  HPS::UTF8 GetValueAsString() const;
2771 
2774  void SetValue(unsigned int in_value);
2775 };
2776 
2777 
2779 class SPRK_API BooleanMetadata : public Metadata
2780 {
2781 public:
2783  BooleanMetadata();
2784 
2788  BooleanMetadata(Metadata const & in_that);
2789 
2792  BooleanMetadata(BooleanMetadata const & in_that);
2793 
2796  BooleanMetadata(BooleanMetadata && in_that);
2797 
2801  BooleanMetadata(char const * in_name, bool in_value);
2802 
2803  virtual ~BooleanMetadata();
2804 
2805  HPS::Type ObjectType() const { return HPS::Type::BooleanMetadata; }
2806 
2807 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2808  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
2809 #endif
2810 
2814  BooleanMetadata & operator=(BooleanMetadata && in_that);
2815 
2816 
2819  bool GetValue() const;
2820 
2823  void SetValue(bool in_value);
2824 };
2825 
2826 
2827 
2829 class SPRK_API Factory : public Sprocket
2830 {
2831 public:
2832 
2835  static CanvasArray GetCanvases();
2836 
2839  static LayoutArray GetLayouts();
2840 
2843  static ViewArray GetViews();
2844 
2847  static ModelArray GetModels();
2848 
2851  static CADModelArray GetCADModels();
2852 
2858  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
2859 
2864  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
2865 
2871  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
2872 
2876  static Layout CreateLayout(char const * in_name = "");
2877 
2881  static View CreateView(char const * in_name = "");
2882 
2886  static Model CreateModel(char const * in_name = "");
2887 
2888  static Component CreateComponent(HPS::Component const & in_owner, char const * in_name = "");
2889 
2890 private:
2891  Factory() {}
2892 };
2893 
2903 class SPRK_API AxisTriadOperator : public Operator
2904 {
2905 public:
2906  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2908  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
2909 
2915  virtual bool OnMouseDown(MouseState const & in_state);
2920  virtual bool OnMouseUp(MouseState const & in_state);
2925  virtual bool OnMouseMove(MouseState const & in_state);
2926 
2931  virtual bool OnTouchDown(TouchState const & in_state);
2936  virtual bool OnTouchUp(TouchState const & in_state);
2941  virtual bool OnTouchMove(TouchState const & in_state);
2942 
2943  virtual void OnViewAttached();
2944  virtual void OnViewDetached();
2945 
2946 private:
2947 
2948  bool AxisOrbit(HPS::WindowPoint const & in_loc);
2949  void Transition(HPS::SelectionResults selection_results);
2950  void TranslatePoint(HPS::WindowPoint * point);
2951  bool IsEventRelevant(HPS::Point const & event_location);
2952 
2953  bool operator_active;
2954  HPS::WindowPoint start_point;
2955  HPS::Vector start_sphere_point;
2956  float axis_subwindow_width;
2957  float axis_subwindow_height;
2958  HPS::TouchID tracked_touch_ID;
2959  HPS::Rectangle axis_subwindow;
2960  HPS::SegmentKey axis_triad_segment;
2961 
2962 };
2963 
2966 {
2967 public:
2970  virtual ~SmoothTransitionCompleteEvent();
2971 
2974  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
2975  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
2976 
2979  SmoothTransitionCompleteEvent(Event const & in_event) : Event(in_event)
2980  {
2981  if (in_event.GetChannel() == Object::ClassID<SmoothTransitionCompleteEvent>())
2982  {
2983  auto that = static_cast<SmoothTransitionCompleteEvent const &>(in_event);
2984  view = that.view;
2985  }
2986  else
2987  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2988  }
2989 
2992  Event * Clone() const
2993  {
2995  return new_event;
2996  }
2997 
3001  virtual bool Drop(Event const * in_that_event) const
3002  {
3003  HPS_UNREFERENCED(in_that_event);
3004  return false;
3005  }
3006 
3007  HPS::View view;
3008 };
3009 
3019 class SPRK_API NavigationCubeOperator : public Operator
3020 {
3021 public:
3022  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3023  ~NavigationCubeOperator() { OnViewDetached(); }
3024 
3026  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3027 
3032  virtual bool OnMouseDown(MouseState const & in_state);
3037  virtual bool OnMouseUp(MouseState const & in_state);
3042  virtual bool OnMouseMove(MouseState const & in_state);
3043 
3047  virtual bool OnTouchDown(TouchState const & in_state);
3052  virtual bool OnTouchUp(TouchState const & in_state);
3057  virtual bool OnTouchMove(TouchState const & in_state);
3058 
3059  virtual void OnViewAttached();
3060  virtual void OnViewDetached();
3061 
3062  virtual void OnModelAttached();
3063 
3064  void UpdateHighlightColor();
3065 
3069  void SetReferenceSegment(HPS::SegmentKey const & in_segment);
3070 
3075  void SetReferenceSegment(HPS::SegmentKeyArray const & in_segments);
3076 
3080  HPS::SegmentKeyArray ShowReferenceSegment();
3081 
3082 private:
3083  void Transition(HPS::SelectionResults selection_results);
3084  bool Orbit(HPS::WindowPoint const & in_loc);
3085  void TranslatePoint(HPS::WindowPoint * point);
3086  bool IsEventRelevant(HPS::Point const & event_location);
3087  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3088 
3089  bool operator_active;
3090  HPS::TouchID tracked_touch_ID;
3091  HPS::WindowPoint start_point;
3092  HPS::WindowPoint down_position;
3093  HPS::Vector start_sphere_point;
3094  HPS::SegmentKeyArray reference_segments; //rotation and zooming happen around these segments
3095 
3096  HPS::SegmentKey nav_cube_segment;
3097  HPS::SegmentKey style_segment;
3098  HPS::PortfolioKey portfolio;
3099  HPS::ReferenceKeyArrayArray groups;
3100  HPS::HighlightOptionsKit highlight_options_kit;
3101  HPS::CameraKit previous_camera;
3102  int previous_face;
3103  bool suppress_mouse_over_highlights;
3104 
3105  HPS::Rectangle nav_cube_subwindow;
3106  float nav_cube_subwindow_width;
3107  float nav_cube_subwindow_height;
3108 
3109  int highlighted_group;
3110 
3111  bool moving;
3112 
3113  class SmoothTransitionCompleteEventHandler : public EventHandler
3114  {
3115  public:
3116  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3117  : handler_view(in_view), handler_moving(&in_moving) {}
3118 
3119  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3120 
3121  virtual HandleResult Handle(HPS::Event const * in_event);
3122 
3123  private:
3124  View handler_view;
3125  bool * handler_moving;
3126  };
3127 
3128  SmoothTransitionCompleteEventHandler * handler;
3129 };
3130 
3131 
3132 
3133 
3134 class SceneTreeItem;
3135 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3136 class SceneTree;
3137 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3138 
3141 class SPRK_API SceneTree : public Sprocket
3142 {
3143 public:
3146  enum class ItemType : uint32_t
3147  {
3148  None = 0x00000000,
3149  GenericMask = 0xffff0000,
3150 
3151  Segment = 0x00000001,
3152  Include = 0x00000002,
3153  ConditionalExpression = 0x00000003,
3154  StaticModelSegment = 0x00000004,
3155  AttributeFilter = 0x00000005,
3156 
3157  Geometry = 0x00010000,
3158  CuttingSection = 0x00010001,
3159  Shell = 0x00010002,
3160  Mesh = 0x00010003,
3161  Grid = 0x00010004,
3162  NURBSSurface = 0x00010005,
3163  Cylinder = 0x00010006,
3164  Sphere = 0x00010007,
3165  Polygon = 0x00010008,
3166  Circle = 0x00010009,
3167  CircularWedge = 0x0001000a,
3168  Ellipse = 0x0001000b,
3169  Line = 0x0001000c,
3170  NURBSCurve = 0x0001000d,
3171  CircularArc = 0x0001000e,
3172  EllipticalArc = 0x0001000f,
3173  InfiniteLine = 0x00010010,
3174  InfiniteRay = 0x00010011,
3175  Marker = 0x00010012,
3176  Text = 0x00010013,
3177  Reference = 0x00010014,
3178  DistantLight = 0x00010015,
3179  Spotlight = 0x00010016,
3180 
3181  Attribute = 0x00020000,
3182  Portfolio = 0x00020001,
3183  SegmentStyle = 0x00020002,
3184  NamedStyle = 0x00020003,
3185  MaterialPalette = 0x00020004,
3186  Priority = 0x00020005,
3187  Material = 0x00020006,
3188  Camera = 0x00020007,
3189  ModellingMatrix = 0x00020008,
3190  UserData = 0x00020009,
3191  TextureMatrix = 0x0002000a,
3192  Culling = 0x0002000b,
3193  CurveAttribute = 0x0002000c,
3194  CylinderAttribute = 0x0002000d,
3195  EdgeAttribute = 0x0002000e,
3196  LightingAttribute = 0x0002000f,
3197  LineAttribute = 0x00020010,
3198  MarkerAttribute = 0x00020011,
3199  SurfaceAttribute = 0x00020012,
3200  Selectability = 0x00020013,
3201  SphereAttribute = 0x00020014,
3202  Subwindow = 0x00020015,
3203  TextAttribute = 0x00020016,
3204  Transparency = 0x00020017,
3205  Visibility = 0x00020018,
3206  VisualEffects = 0x00020019,
3207  Performance = 0x00020020,
3208  DrawingAttribute = 0x00020021,
3209  HiddenLineAttribute = 0x00020022,
3210  ContourLine = 0x00020023,
3211  Condition = 0x00020024,
3212  Bounding = 0x00020025,
3213  AttributeLock = 0x00020026,
3214  TransformMask = 0x00020027,
3215  ColorInterpolation = 0x00020028,
3216  CuttingSectionAttribute = 0x00020029,
3217 
3218  // window only attributes
3219  Debugging = 0x00020030,
3220  PostProcessEffects = 0x00020031,
3221  SelectionOptions = 0x00020032,
3222  UpdateOptions = 0x00020033,
3223 
3224  Definition = 0x00040000,
3225  NamedStyleDefinition = 0x00040001,
3226  TextureDefinition = 0x00040002,
3227  LinePatternDefinition = 0x00040003,
3228  GlyphDefinition = 0x00040004,
3229  CubeMapDefinition = 0x00040005,
3230  ImageDefinition = 0x00040006,
3231  MaterialPaletteDefinition = 0x00040007,
3232  ShaderDefinition = 0x00040008,
3233 
3234  Group = 0x00080000,
3235  SegmentGroup = 0x00080100,
3236  GeometryGroup = 0x00080200,
3237  AttributeGroup = 0x00080300,
3238  PortfolioGroup = 0x00080400,
3239  StyleGroup = 0x00080500,
3240  IncludeGroup = 0x00080600,
3241  DefinitionGroup = 0x00180000,
3242  NamedStyleDefinitionGroup = 0x00180700,
3243  TextureDefinitionGroup = 0x00180800,
3244  LinePatternDefinitionGroup = 0x00180900,
3245  GlyphDefinitionGroup = 0x00180a00,
3246  CubeMapDefinitionGroup = 0x00180b00,
3247  ImageDefinitionGroup = 0x00180c00,
3248  MaterialPaletteDefinitionGroup = 0x00180d00,
3249  ShaderDefinitionGroup = 0x00180e00,
3250  CuttingSectionGroup = 0x00080001,
3251  ShellGroup = 0x00080002,
3252  MeshGroup = 0x00080003,
3253  GridGroup = 0x00080004,
3254  NURBSSurfaceGroup = 0x00080005,
3255  CylinderGroup = 0x00080006,
3256  SphereGroup = 0x00080007,
3257  PolygonGroup = 0x00080008,
3258  CircleGroup = 0x00080009,
3259  CircularWedgeGroup = 0x0008000a,
3260  EllipseGroup = 0x0008000b,
3261  LineGroup = 0x0008000c,
3262  NURBSCurveGroup = 0x0008000d,
3263  CircularArcGroup = 0x0008000e,
3264  EllipticalArcGroup = 0x0008000f,
3265  InfiniteLineGroup = 0x00080010,
3266  InfiniteRayGroup = 0x00080011,
3267  MarkerGroup = 0x00080012,
3268  TextGroup = 0x00080013,
3269  ReferenceGroup = 0x00080014,
3270  DistantLightGroup = 0x00080015,
3271  SpotlightGroup = 0x00080016,
3272  };
3273 
3275  SceneTree();
3276 
3279  SceneTree(Canvas const & in_canvas);
3280 
3283  SceneTree(SceneTree const & in_that);
3284 
3287  SceneTree(SceneTree && in_that);
3288 
3289  virtual ~SceneTree();
3290 
3291  virtual HPS::Type ObjectType() const { return HPS::Type::SceneTree; }
3292 
3296  SceneTree & operator=(SceneTree const & in_that);
3297 
3301  SceneTree & operator=(SceneTree && in_that);
3302 
3306  virtual void Assign(SceneTree const & in_that);
3307 
3311  bool Equals(SceneTree const & in_that) const;
3312 
3316  bool operator!=(SceneTree const & in_that) const;
3317 
3321  bool operator==(SceneTree const & in_that) const;
3322 
3323 
3332  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3333 
3343  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3344 
3355  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3356 
3364  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3365 
3368  HighlightOptionsKitArray GetHighlightOptions() const;
3369 
3370 
3375  void SetGroupingLimit(size_t in_limit);
3376 
3379  size_t GetGroupingLimit() const;
3380 
3381 
3388  void SetRoot(SceneTreeItemPtr const & in_root);
3389 
3392  SceneTreeItemPtr GetRoot() const;
3393 
3394 
3397  virtual void Flush();
3398 
3403  void SetHighlightEventHandling(bool in_state);
3404 
3408  bool GetHighlightEventHandling() const;
3409 };
3410 
3411 
3414 class SPRK_API SceneTreeItem : public Sprocket
3415 {
3416 public:
3418  SceneTreeItem();
3419 
3422  SceneTreeItem(SceneTreeItem const & in_that);
3423 
3426  SceneTreeItem(SceneTreeItem && in_that);
3427 
3433  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3434 
3440  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3441 
3447  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3448 
3454  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3455 
3463  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3464 
3465  virtual ~SceneTreeItem();
3466 
3467  HPS::Type ObjectType() const { return HPS::Type::SceneTreeItem; }
3468 
3472  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3473 
3477  SceneTreeItem & operator=(SceneTreeItem && in_that);
3478 
3482  virtual void Assign(SceneTreeItem const & in_that);
3483 
3487  bool Equals(SceneTreeItem const & in_that) const;
3488 
3492  bool operator!=(SceneTreeItem const & in_that) const;
3493 
3497  bool operator==(SceneTreeItem const & in_that) const;
3498 
3499 
3502  SceneTreePtr GetTree() const;
3503 
3506  UTF8 GetTitle() const;
3507 
3510  SceneTree::ItemType GetItemType() const;
3511 
3515  bool HasItemType(SceneTree::ItemType in_mask) const;
3516 
3519  Key GetKey() const;
3520 
3523  KeyPath GetKeyPath() const;
3524 
3527  bool HasChildren() const;
3528 
3529 
3538  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3539 
3540 
3543  virtual void Expand();
3544 
3547  virtual void Collapse();
3548 
3549 
3554  bool IsSelected() const;
3555 
3561  virtual void Select();
3562 
3568  virtual void Unselect();
3569 
3574  bool IsHighlightable() const;
3575 
3581  bool IsHighlighted() const;
3582 
3587  void Highlight(size_t in_highlight_options_index = 0);
3588 
3594  void Highlight(HighlightOptionsKit const & in_highlight_options);
3595 
3601  void Unhighlight(size_t in_highlight_options_index = 0);
3602 
3609  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3610 };
3611 
3612 
3613 
3614 class ComponentTreeItem;
3615 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3616 class ComponentTree;
3617 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3618 
3621 class SPRK_API ComponentTree : public Sprocket
3622 {
3623 public:
3626  enum class ItemType
3627  {
3628  None,
3629  ExchangeComponent,
3630  ExchangeModelFile,
3631 
3632  ExchangeViewGroup,
3633  ExchangeAnnotationViewGroup,
3634  ExchangePMIGroup,
3635  ExchangeModelGroup,
3636 
3637  ParasolidComponent,
3638  ParasolidModelFile,
3639 
3640  DWGComponent,
3641  DWGModelFile,
3642  };
3643 
3645  ComponentTree();
3646 
3650  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3651 
3654  ComponentTree(ComponentTree const & in_that);
3655 
3658  ComponentTree(ComponentTree && in_that);
3659 
3660  virtual ~ComponentTree();
3661 
3662  virtual HPS::Type ObjectType() const { return HPS::Type::ComponentTree; }
3663 
3667  ComponentTree & operator=(ComponentTree const & in_that);
3668 
3672  ComponentTree & operator=(ComponentTree && in_that);
3673 
3677  virtual void Assign(ComponentTree const & in_that);
3678 
3682  bool Equals(ComponentTree const & in_that) const;
3683 
3687  bool operator!=(ComponentTree const & in_that) const;
3688 
3692  bool operator==(ComponentTree const & in_that) const;
3693 
3694 
3703  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3704 
3714  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3715 
3726  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3727 
3737  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3738 
3741  HighlightOptionsKitArray GetHighlightOptions() const;
3742 
3743 
3750  void SetRoot(ComponentTreeItemPtr const & in_root);
3751 
3754  ComponentTreeItemPtr GetRoot() const;
3755 
3756 
3759  virtual void Flush();
3760 
3763  void ReExpand();
3764 
3769  void SetHighlightEventHandling(bool in_state);
3770 
3774  bool GetHighlightEventHandling() const;
3775 };
3776 
3777 
3780 class SPRK_API ComponentTreeItem : public Sprocket
3781 {
3782 public:
3785 
3788  ComponentTreeItem(ComponentTreeItem const & in_that);
3789 
3793 
3799  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
3800 
3807  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
3808 
3809  virtual ~ComponentTreeItem();
3810 
3811  HPS::Type ObjectType() const { return HPS::Type::ComponentTreeItem; }
3812 
3816  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
3817 
3821  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
3822 
3826  virtual void Assign(ComponentTreeItem const & in_that);
3827 
3831  bool Equals(ComponentTreeItem const & in_that) const;
3832 
3836  bool operator!=(ComponentTreeItem const & in_that) const;
3837 
3841  bool operator==(ComponentTreeItem const & in_that) const;
3842 
3843 
3844 
3847  ComponentTreePtr GetTree() const;
3848 
3851  UTF8 GetTitle() const;
3852 
3855  ComponentTree::ItemType GetItemType() const;
3856 
3859  Component GetComponent() const;
3860 
3863  bool HasChildren() const;
3864 
3867  ComponentPath GetPath() const;
3868 
3869 
3877  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
3878 
3879 
3882  virtual void Expand();
3883 
3886  virtual void Collapse();
3887 
3888 
3894  bool IsHighlighted() const;
3895 
3900  virtual void OnHighlight(HighlightOptionsKit const & in_options);
3901 
3906  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
3907 
3908 
3913  void Highlight(size_t in_highlight_options_index = 0);
3914 
3920  void Highlight(HighlightOptionsKit const & in_highlight_options);
3921 
3926  void Unhighlight(size_t in_highlight_options_index = 0);
3927 
3933  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3934 
3935 
3945  bool IsHidden() const;
3946 
3950  virtual void OnHide();
3951 
3955  virtual void OnShow();
3956 
3960  void Hide();
3961 
3965  void Show();
3966 
3971  void Isolate();
3972 
3975  bool IsExpanded() const;
3976 
3979  void ReExpand();
3980 };
3981 
3982 
3983 
3984 
3985 }
3986 #endif
3987 
3988 
3989 
Definition: sprk.h:2726
HPS::Type ObjectType() const
Definition: sprk.h:2560
Definition: hps.h:6097
Definition: sprk.h:964
HPS::Type ObjectType() const
Definition: sprk.h:452
Event * Clone() const
Definition: sprk.h:717
Definition: sprk.h:2903
Definition: sprk.h:237
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2161
HPS::Type ObjectType() const
Definition: sprk.h:245
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1161
Definition: hps.h:39075
ComponentHighlightEvent()
Definition: sprk.h:2143
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:2212
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5606
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:3626
Definition: hps.h:5646
virtual intptr_t Freshen() const
Definition: sprk.h:1006
CaptureActivationEvent()
Definition: sprk.h:2334
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:3780
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1121
Definition: sprk.h:2779
HPS::Type ObjectType() const
Definition: sprk.h:2401
Definition: hps.h:38862
Definition: hps.h:1312
Definition: hps.h:1030
HPS::Type ObjectType() const
Definition: sprk.h:1911
Definition: hps.h:1655
ModelDeletedEvent()
Definition: sprk.h:925
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:2974
Definition: sprk.h:3621
Definition: hps.h:43370
Definition: sprk.h:1024
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1136
Definition: hps.h:7473
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1182
virtual HPS::Type ObjectType() const
Definition: sprk.h:3291
Definition: hps.h:3458
Definition: hps.h:1992
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:1380
Definition: hps.h:851
HPS::Type ObjectType() const
Definition: sprk.h:1520
Definition: hps.h:38980
virtual void OnModelDetached()
Definition: sprk.h:1175
SmoothTransitionCompleteEvent(Event const &in_event)
Definition: sprk.h:2979
Definition: hps.h:1702
Definition: hps.h:1500
Definition: hps.h:8640
Definition: hps.h:248
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1178
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1762
Event * Clone() const
Definition: sprk.h:867
CameraChangedEvent()
Definition: sprk.h:968
Definition: hps.h:43269
Definition: hps.h:37952
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:37998
HPS::Type ObjectType() const
Definition: sprk.h:3467
LayoutDeletedEvent()
Definition: sprk.h:731
Event * Clone() const
Definition: sprk.h:911
virtual void OnViewAttached()
Definition: sprk.h:1164
Definition: hps.h:37427
Definition: hps.h:40271
Definition: hps.h:1070
Definition: sprk.h:2470
LayoutDetachedEvent()
Definition: sprk.h:686
Definition: sprk.h:2582
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1126
Definition: hps.h:9372
Definition: hps.h:39023
Definition: hps.h:1459
SmoothTransitionCompleteEvent()
Definition: sprk.h:2969
Definition: hps.h:1400
HPS::Type ObjectType() const
Definition: sprk.h:531
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1106
FilterActivationEvent()
Definition: sprk.h:2246
Definition: hps.h:1419
virtual void OnModelAttached()
Definition: sprk.h:1171
Definition: hps.h:35838
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2260
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:895
HPS::Type ObjectType() const
Definition: sprk.h:1385
HPS::Type ObjectType() const
Definition: sprk.h:1724
Definition: hps.h:6846
Location
Definition: sprk.h:1492
Definition: hps.h:42761
Definition: sprk.h:2534
Definition: sprk.h:1488
Definition: hps.h:40448
HPS::Type ObjectType() const
Definition: sprk.h:1232
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:227
Definition: hps.h:41814
virtual UTF8 GetName() const
Definition: sprk.h:1096
Definition: hps.h:43157
Definition: sprk.h:682
Event * Clone() const
Definition: sprk.h:2277
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2348
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1131
HPS::Type ObjectType() const
Definition: sprk.h:2656
CanvasDeletedEvent()
Definition: sprk.h:643
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1116
HPS::Type ObjectType() const
Definition: sprk.h:2490
HPS::Type ObjectType() const
Definition: sprk.h:2608
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:222
Event * Clone() const
Definition: sprk.h:2364
UpdateType
Definition: hps.h:182
Definition: hps.h:14804
ViewDeletedEvent()
Definition: sprk.h:837
intptr_t GetChannel() const
Definition: hps.h:6230
Definition: sprk.h:770
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:3001
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2908
Definition: sprk.h:1614
Definition: hps.h:40725
Definition: hps.h:42426
virtual bool OnTextInput(HPS::UTF8 const &in_text)
Definition: sprk.h:1156
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:852
Definition: hps.h:35424
Definition: sprk.h:2678
ViewDetachedEvent()
Definition: sprk.h:781
Definition: hps.h:6197
Definition: sprk.h:1210
Definition: hps.h:410
HPS::Type ObjectType() const
Definition: sprk.h:2704
Event * Clone() const
Definition: sprk.h:2178
Definition: sprk.h:445
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:658
Definition: sprk.h:3019
Definition: sprk.h:1880
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:996
ComponentType
Definition: sprk.h:1619
Definition: hps.h:41740
Definition: hps.h:2011
Definition: sprk.h:2132
Event * Clone() const
Definition: sprk.h:673
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:701
HPS::Type ObjectType() const
Definition: sprk.h:3811
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1101
ItemType
Definition: sprk.h:3146
Definition: sprk.h:2191
Definition: sprk.h:2829
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3026
Definition: sprk.h:184
Definition: sprk.h:2965
Definition: hps.h:429
Event * Clone() const
Definition: sprk.h:955
Definition: sprk.h:2290
Definition: hps.h:2027
ModelDetachedEvent()
Definition: sprk.h:880
static MouseButtons ButtonLeft()
Definition: hps.h:42879
virtual HPS::Type ObjectType() const
Definition: sprk.h:3662
Definition: sprk.h:3141
Definition: sprk.h:2630
Definition: hps.h:8758
HPS::Type ObjectType() const
Definition: sprk.h:1034
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1193
Definition: hps.h:7392
Definition: sprk.h:2235
Definition: hps.h:35040
Definition: hps.h:355
Event * Clone() const
Definition: sprk.h:2992
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:8972
Definition: hps.h:10409
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1141
Definition: sprk.h:3414
Definition: sprk.h:2376
Mode
Definition: sprk.h:189
Definition: hps.h:515
Definition: sprk.h:1065
Definition: hps.h:1113
Definition: hps.h:38907
Definition: sprk.h:833
Definition: sprk.h:2330
Definition: hps.h:37490
HPS::Type ObjectType() const
Definition: sprk.h:2752
HPS::Type ObjectType() const
Definition: sprk.h:2311
HPS::Type ObjectType() const
Definition: sprk.h:2805
Definition: hps.h:7104
Event * Clone() const
Definition: sprk.h:1013