API Search || Global Search
sprk.h
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef SPRK_H
11 #define SPRK_H
12 
13 #include "hps.h"
14 
15 #include <memory>
16 
17 #ifdef _MSC_VER
18 # pragma warning(disable: 4251) //Not an issue as long as debug and release libraries aren't mixed
19 #ifndef STATIC_APP
20 # ifdef SPRK
21 # define SPRK_API __declspec (dllexport)
22 # else
23 # define SPRK_API __declspec (dllimport)
24 # endif
25 #endif
26 #else
27 # include <stddef.h>
28 # if defined(LINUX_SYSTEM) && defined(SPRK)
29 # ifndef STATIC_APP
30 # define SPRK_API __attribute__ ((visibility ("default")))
31 # endif
32 # endif
33 #endif
34 
35 #ifndef SPRK_API
36 # define SPRK_API
37 #endif
38 namespace SPRKI
39 {
40  class X;
41 };
42 
43 namespace HPS
44 {
45 
46 class Factory;
47 class Canvas;
48 class Layout;
49 class View;
50 class Model;
51 class Operator;
52 class OperatorControl;
53 class NavigationCubeControl;
54 class AxisTriadControl;
55 class Component;
56 class ComponentPath;
57 class ComponentHighlightEvent;
58 class Filter;
59 class Capture;
60 class CADModel;
61 class Metadata;
62 
63 
64 
65 
66 class SPRK_API Sprocket : public HPS::Object
67 {
68 public:
69  Sprocket() {}
70 #if !defined(_MSC_VER) || _MSC_VER >= 1900
71  Sprocket(HPS::Sprocket const & in_that) = default;
72 #endif
73  Sprocket(Sprocket && in_that) : HPS::Object(std::move(in_that)) {}
74 
75  virtual ~Sprocket() {}
76 };
77 
78 typedef std::shared_ptr<Operator> OperatorPtr;
79 
80 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
81 
82 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
83 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
84 typedef std::vector<View, Allocator<View> > ViewArray;
85 typedef std::vector<Model, Allocator<Model> > ModelArray;
86 
87 typedef std::vector<Component, Allocator<Component> > ComponentArray;
88 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
89 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
90 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
91 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
92 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
93 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
94 typedef std::vector<HighlightOptionsKit, Allocator<HighlightOptionsKit>> HighlightOptionsKitArray;
95 
96 
100 class SPRK_API Canvas : public Sprocket
101 {
102 public:
103  Canvas();
104  Canvas(Canvas const & that);
105  ~Canvas();
106 
107  HPS::Type ObjectType() const { return HPS::Type::Canvas; }
108 
110  void Delete();
111 
112  Canvas & operator=(Canvas const & in_that);
113  void Assign(Canvas const & in_that);
114 
115  bool Equals(Canvas const & in_that) const;
116  bool operator!= (Canvas const & in_that) const;
117  bool operator== (Canvas const & in_that) const;
118 
120  UTF8 GetName() const;
121 
125  void AttachLayout(Layout const & in_layout);
126 
130  void AttachViewAsLayout(View const & in_view);
131 
133  void DetachLayout();
134 
136  Layout GetAttachedLayout() const;
137 
139  IncludeKey GetAttachedLayoutIncludeLink() const;
140 
142  View GetFrontView() const;
143 
144  WindowKey const GetWindowKey() const;
145 
148  WindowKey GetWindowKey();
149 
150  PortfolioKey const GetPortfolioKey() const;
151 
153  PortfolioKey GetPortfolioKey();
154 
156  void Update() const;
157 
160  UpdateNotifier UpdateWithNotifier() const;
161 
165  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
166 
171  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
172 
176  void SetFrameRate(float in_frame_rate=20);
177 
181  float GetFrameRate() const;
182 };
183 
184 class SPRK_API Rendering
185 {
186 public:
189  enum class Mode
190  {
191  Gouraud,
192  GouraudWithLines,
193  Flat,
194  FlatWithLines,
195  Phong,
196  PhongWithLines,
197  HiddenLine,
198  FastHiddenLine,
199  Wireframe,
200  Default = Phong
201  };
202 
203 private:
204  Rendering() {}
205 };
206 
207 class SPRK_API SprocketControl : public Sprocket
208 {
209 public:
210  HPS::Type ObjectType() const {return HPS::Type::SprocketControl;}
211 
212 #if !defined(_MSC_VER) || _MSC_VER >= 1900
213  SprocketControl(HPS::SprocketControl const & in_that) = default;
214 #endif
215 
216 protected:
217  SprocketControl() {}
218 
222  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
223 
228  {
229  this->Object::operator=(std::move(in_that));
230  return *this;
231  }
232 };
233 
234 class SPRK_API SprocketKit : public Sprocket
235 {
236 public:
237  HPS::Type ObjectType() const { return HPS::Type::SprocketKit; }
238 
239 #if !defined(_MSC_VER) || _MSC_VER >= 1900
240  SprocketKit(HPS::SprocketKit const & in_that) = default;
241 #endif
242 
243 protected:
244  SprocketKit() {}
245 
249  SprocketKit(SprocketKit && in_that) : Sprocket(std::move(in_that)) {}
250 
255  {
256  this->Object::operator=(std::move(in_that));
257  return *this;
258  }
259 };
260 
264 class SPRK_API View : public Sprocket
265 {
266 public:
267  View();
268  View(View const & that);
269  explicit View(SprocketControl const & in_ctrl);
270  ~View();
271 
272  HPS::Type ObjectType() const { return HPS::Type::View; }
273 
275  void Delete();
276 
277  View & operator=(View const & in_that);
278  void Assign(View const & in_that);
279 
280  bool Equals(View const & in_that) const;
281  bool operator!= (View const & in_that) const;
282  bool operator== (View const & in_that) const;
283 
285  UTF8 GetName() const;
286 
287 
290  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
291 
295  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
296 
297 
301  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
302 
308  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
309 
310 
316  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
317 
318 
320  HPS::View & FitWorld();
321 
324  HPS::View & FitWorld(SegmentKey const & in_segment);
325 
326 
329  HPS::View & FitWorld(BoundingKit const & in_bounding);
330 
335  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
336 
337 
342  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
343 
348  void AttachModel(Model const & in_model);
349 
351  void DetachModel();
352 
354  Model GetAttachedModel() const;
355 
357  IncludeKey GetAttachedModelIncludeLink() const;
358 
362  void SetRenderingMode(Rendering::Mode in_mode);
363 
366  Rendering::Mode GetRenderingMode() const;
367 
369  OperatorPtrArray GetOperators() const;
370 
373  void SetOperators(OperatorPtrArray & in_operators);
374 
378  void SetOperators(size_t in_count, OperatorPtr in_operators []);
379 
382  void SetOperator(OperatorPtr const & in_operator);
383 
387  void SetOperator(Operator * in_operator);
388 
390  OperatorControl GetOperatorControl();
391  OperatorControl const GetOperatorControl() const;
392 
394  NavigationCubeControl GetNavigationCubeControl();
395  NavigationCubeControl const GetNavigationCubeControl() const;
396 
398  AxisTriadControl GetAxisTriadControl();
399  AxisTriadControl const GetAxisTriadControl() const;
400 
403  SegmentKey GetSegmentKey();
404  SegmentKey const GetSegmentKey() const;
405 
408  SegmentKey GetModelOverrideSegmentKey();
409  SegmentKey const GetModelOverrideSegmentKey() const;
410 
411 
412  PortfolioKey const GetPortfolioKey() const;
413 
415  PortfolioKey GetPortfolioKey();
416 
421  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
422 
424  bool GetSimpleShadow();
425 
430  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
431 
433  bool GetSimpleReflection();
434 
436  void Update() const;
437 
440  UpdateNotifier UpdateWithNotifier() const;
441 
445  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
446 
452  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
453 
457  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
458 
459  static UTF8 GetHideStyleName();
460  static UTF8 GetShowStyleName();
461 
463  KeyArray const GetNavigationKeys();
464 
466  LayoutArray GetOwningLayouts();
467  LayoutArray const GetOwningLayouts() const;
468 };
469 
473 class SPRK_API Model : public Sprocket
474 {
475 public:
476  Model();
477  Model(Model const & that);
478  ~Model();
479 
480  HPS::Type ObjectType() const { return HPS::Type::Model; }
481 
483  void Delete();
484 
485  Model & operator=(Model const & in_that);
486  void Assign(Model const & in_that);
487 
488  bool Equals(Model const & in_that) const;
489  bool operator!= (Model const & in_that) const;
490  bool operator== (Model const & in_that) const;
491 
493  UTF8 GetName() const;
494 
497  SegmentKey GetSegmentKey();
498  SegmentKey const GetSegmentKey() const;
499 
501  SegmentKey GetLibraryKey();
502  SegmentKey const GetLibraryKey() const;
503 
505  PortfolioKey GetPortfolioKey();
506  PortfolioKey const GetPortfolioKey() const;
507 
509  HPS::Vector GetUpVector();
510  HPS::Vector const GetUpVector() const;
511 
513  HPS::Vector GetFrontVector();
514  HPS::Vector const GetFrontVector() const;
515 
517  HPS::ViewArray GetOwningViews();
518  HPS::ViewArray const GetOwningViews() const;
519 
523  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
524 
526  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector) const;
527 
529  void Update() const;
530 
533  UpdateNotifier UpdateWithNotifier() const;
534 
538  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
539 
545  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
546 
547 };
548 
552 class SPRK_API Layout : public Sprocket
553 {
554 public:
555  Layout();
556  Layout(Layout const & that);
557  ~Layout();
558 
559  HPS::Type ObjectType() const { return HPS::Type::Layout; }
560 
562  void Delete();
563 
564  Layout & operator=(Layout const & in_that);
565  void Assign(Layout const & in_that);
566 
567  bool Equals(Layout const & in_that) const;
568  bool operator!= (Layout const & in_that) const;
569  bool operator== (Layout const & in_that) const;
570 
572  UTF8 GetName() const;
573 
575  size_t GetLayerCount() const;
576 
580  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
584  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
585 
588  void DetachLayer(size_t in_layer);
589 
592  void DetachView(View const & in_view); // everywhere it occurs
593 
596  void BringToFront(size_t in_layer);
597 
601  void ReassignLayer(size_t in_layer, HPS::View in_view);
602 
606  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
607 
609  View GetFrontView() const;
610 
614  View GetAttachedView(size_t in_layer = 0) const;
615 
619  Rectangle GetPosition(size_t in_layer) const;
620 
622  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
623 
625  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
626 
630  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
631 
635  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
636 
639  SegmentKey GetSegmentKey();
640  SegmentKey const GetSegmentKey() const;
641 
643  CanvasArray GetOwningCanvases();
644  CanvasArray const GetOwningCanvases() const;
645 
647  void Update() const;
648 
651  UpdateNotifier UpdateWithNotifier() const;
652 
656  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
657 
663  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
664 
665 };
666 
667 class SPRK_API CanvasDeletedEvent : public Event
668 {
669 public:
672  {
673  channel = GetClassID();
674  consumable = false;
675  }
676 
677  CanvasDeletedEvent(Canvas const & in_canvas)
678  : Event(), canvas(in_canvas)
679  {
680  channel = GetClassID();
681  consumable = false;
682  }
683 
686  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
687  {
688  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
689  {
690  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
691  canvas = that.canvas;
692  }
693  else
694  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
695  }
696 
698 
701  Event * Clone() const
702  {
703  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
704  return new_event;
705  }
706 
707  Canvas canvas;
708 };
709 
710 class SPRK_API LayoutDetachedEvent : public Event
711 {
712 public:
715  {
716  channel = GetClassID();
717  consumable = false;
718  }
719 
720  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
721  : Event(), canvas(in_canvas), layout(in_layout)
722  {
723  channel = GetClassID();
724  consumable = false;
725  }
726 
729  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
730  {
731  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
732  {
733  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
734  canvas = that.canvas;
735  layout = that.layout;
736  }
737  else
738  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
739  }
740 
742 
745  Event * Clone() const
746  {
747  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
748  return new_event;
749  }
750 
751  Canvas canvas;
752  Layout layout;
753 };
754 
755 class SPRK_API LayoutDeletedEvent : public Event
756 {
757 public:
760  {
761  channel = GetClassID();
762  consumable = false;
763  }
764 
765  LayoutDeletedEvent(Layout const & in_layout)
766  : Event(), layout(in_layout)
767  {
768  channel = GetClassID();
769  consumable = false;
770  }
771 
774  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
775  {
776  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
777  {
778  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
779  layout = that.layout;
780  }
781  else
782  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
783  }
784 
786 
789  Event * Clone() const
790  {
791  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
792  return new_event;
793  }
794 
795  Layout layout;
796 };
797 
798 class SPRK_API ViewDetachedEvent : public Event
799 {
800 public:
801  enum class Action
802  {
803  None = 0,
804  SpecificLayer,
805  AllLayers,
806  };
807 
809  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
810  {
811  channel = GetClassID();
812  consumable = false;
813  }
814 
815  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
816  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
817  {
818  channel = GetClassID();
819  consumable = false;
820  }
821 
822  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
823  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
824  {
825  channel = GetClassID();
826  consumable = false;
827  }
828 
831  ViewDetachedEvent(Event const & in_event) : Event(in_event)
832  {
833  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
834  {
835  auto that = static_cast<ViewDetachedEvent const &>(in_event);
836  layout = that.layout;
837  action = that.action;
838  layer = that.layer;
839  view = that.view;
840  }
841  else
842  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
843  }
844 
846 
849  Event * Clone() const
850  {
851  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
852  return new_event;
853  }
854 
855  Layout layout;
856  Action action;
857  size_t layer;
858  View view;
859 };
860 
861 class SPRK_API ViewDeletedEvent : public Event
862 {
863 public:
866  {
867  channel = GetClassID();
868  consumable = false;
869  }
870 
871  ViewDeletedEvent(View const & in_view)
872  : Event(), view(in_view)
873  {
874  channel = GetClassID();
875  consumable = false;
876  }
877 
880  ViewDeletedEvent(Event const & in_event) : Event(in_event)
881  {
882  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
883  {
884  auto that = static_cast<ViewDeletedEvent const &>(in_event);
885  view = that.view;
886  }
887  else
888  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
889  }
890 
891  ~ViewDeletedEvent();
892 
895  Event * Clone() const
896  {
897  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
898  return new_event;
899  }
900 
901  View view;
902 };
903 
904 class SPRK_API ModelDetachedEvent : public Event
905 {
906 public:
909  {
910  channel = GetClassID();
911  consumable = false;
912  }
913 
914  ModelDetachedEvent(View const & in_view, Model const & in_model)
915  : Event(), view(in_view), model(in_model)
916  {
917  channel = GetClassID();
918  consumable = false;
919  }
920 
923  ModelDetachedEvent(Event const & in_event) : Event(in_event)
924  {
925  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
926  {
927  auto that = static_cast<ModelDetachedEvent const &>(in_event);
928  view = that.view;
929  model = that.model;
930  }
931  else
932  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
933  }
934 
936 
939  Event * Clone() const
940  {
941  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
942  return new_event;
943  }
944 
945  View view;
946  Model model;
947 };
948 
949 class SPRK_API ModelDeletedEvent : public Event
950 {
951 public:
954  {
955  channel = GetClassID();
956  consumable = false;
957  }
958 
959  ModelDeletedEvent(Model const & in_model)
960  : Event(), model(in_model)
961  {
962  channel = GetClassID();
963  consumable = false;
964  }
965 
968  ModelDeletedEvent(Event const & in_event) : Event(in_event)
969  {
970  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
971  {
972  auto that = static_cast<ModelDeletedEvent const &>(in_event);
973  model = that.model;
974  }
975  else
976  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
977  }
978 
980 
983  Event * Clone() const
984  {
985  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
986  return new_event;
987  }
988 
989  Model model;
990 };
991 
992 class SPRK_API CameraChangedEvent : public Event
993 {
994 public:
997  {
998  channel = GetClassID();
999  consumable = false;
1000  }
1001 
1002  CameraChangedEvent(View const & in_view)
1003  : Event(), view(in_view)
1004  {
1005  channel = GetClassID();
1006  consumable = false;
1007  }
1008 
1011  CameraChangedEvent(Event const & in_event) : Event(in_event)
1012  {
1013  if (in_event.GetChannel() == Object::ClassID<CameraChangedEvent>())
1014  {
1015  auto that = static_cast<CameraChangedEvent const &>(in_event);
1016  view = that.view;
1017  }
1018  else
1019  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
1020  }
1021 
1022  ~CameraChangedEvent();
1023 
1024  virtual bool Drop(Event const * in_that_event) const
1025  {
1026  CameraChangedEvent const * that_event = static_cast<CameraChangedEvent const *>(in_that_event);
1027 
1028  if (view == that_event->view)
1029  return true;
1030 
1031  return false;
1032  }
1033 
1034  virtual intptr_t Freshen() const
1035  {
1036  return GetClassID();
1037  }
1038 
1041  Event * Clone() const
1042  {
1043  CameraChangedEvent * new_event = new CameraChangedEvent(*this);
1044  return new_event;
1045  }
1046 
1047  View view;
1048 };
1049 
1052 class SPRK_API SprocketPath : public Sprocket
1053 {
1054 public:
1055  SprocketPath();
1056  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
1057  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
1058  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
1059  SprocketPath(SprocketPath const & that);
1060  ~SprocketPath();
1061 
1062  HPS::Type ObjectType() const { return HPS::Type::SprocketPath; }
1063 
1064  SprocketPath & operator=(SprocketPath const & in_that);
1065  void Set(SprocketPath const & in_that);
1066 
1067  bool Equals(SprocketPath const & in_that) const;
1068  bool operator!= (SprocketPath const & in_that) const;
1069  bool operator== (SprocketPath const & in_that) const;
1070 
1072  Canvas GetCanvas() const;
1073 
1075  Layout GetLayout() const;
1076 
1078  View GetView() const;
1079 
1081  Model GetModel() const;
1082 
1087  KeyPath GetKeyPath() const;
1088 };
1089 
1090 
1093 class SPRK_API Operator : public Sprocket
1094 {
1095 public:
1096  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1097  Operator(Operator const & in_that);
1098 
1099  virtual ~Operator();
1100 
1101  HPS::Type ObjectType() const { return HPS::Type::Operator; }
1102 
1103  virtual Operator & operator= (Operator const & in_that);
1104 
1106  virtual void Assign(Operator const & in_that);
1107 
1109  virtual bool Equals(Operator const & in_that) const;
1110 
1112  virtual bool operator!= (Operator const & in_that) const;
1113 
1115  virtual bool operator== (Operator const & in_that) const;
1116 
1118  void DetachView();
1119 
1121  View GetAttachedView() const;
1122 
1124  virtual UTF8 GetName() const { return "Operator"; }
1125 
1129  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1130 
1134  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1135 
1139  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1140 
1144  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1145 
1149  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1150 
1154  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1155 
1159  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1160 
1164  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1165 
1169  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1170 
1174  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1175 
1179  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1180 
1184  virtual bool OnTextInput(HPS::UTF8 const & in_text) { HPS_UNREFERENCED(in_text); return false; }
1185 
1189  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1190 
1192  virtual void OnViewAttached() { return; }
1193 
1195  virtual void OnViewDetached() { return; }
1196 
1199  virtual void OnModelAttached() { return; }
1200 
1203  virtual void OnModelDetached() { return; }
1204 
1206  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1207 
1210  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1211 
1215  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1216 
1218  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1219 
1221  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1222 
1223  enum class Priority
1224  {
1225  Low,
1226  Default,
1227  High
1228  };
1229 
1230 protected:
1231 
1232  HPS::MouseButtons mouse_trigger;
1233  HPS::ModifierKeys modifier_trigger;
1234 };
1235 
1236 class SPRK_API OperatorUtility
1237 {
1238  static double internal_acos(double x)
1239  {
1240  return (((x)<-1) ? (HPS::PI) : (((x)>1) ? (0) : (acos(x))));
1241  }
1242 
1243 public:
1244 
1245  enum ProjectedPlane
1246  {
1247  Plane_XY,
1248  Plane_YZ,
1249  Plane_XZ
1250  };
1251 
1252  static void ScreenToSphereMousePoint(HPS::Point const &in_pt, HPS::Vector &out_vec)
1253  {
1254  out_vec = HPS::Vector(in_pt);
1255  float len = static_cast<float>(out_vec.Length());
1256  if (len > 1.0f)
1257  {
1258  out_vec /= len;
1259  out_vec.z = 0;
1260  }
1261  else
1262  out_vec.z = (float)sqrt(1.0f - (len*len));
1263  }
1264 
1265  static float CalculateAngleOrbitOnPlane(HPS::Vector const &axis, ProjectedPlane plane)
1266  {
1267  float theta;
1268 
1269  HPS::Vector vtmp;
1270  if (plane == Plane_XY)
1271  vtmp = HPS::Vector(axis.x, axis.y, 0);
1272  else if (plane == Plane_YZ)
1273  vtmp = HPS::Vector(0, axis.y, axis.z);
1274  else
1275  vtmp = HPS::Vector(axis.x, 0, axis.z);
1276  Vector naxis = axis;
1277 
1278  naxis.Normalize();
1279  vtmp.Normalize();
1280 
1281  float tmp = naxis.Dot(vtmp);
1282  if (static_cast<float>(Abs(tmp)) > 1.001f || static_cast<float>(Abs(tmp)) < 0.999f)
1283  theta = static_cast<float>(internal_acos(tmp));
1284  else
1285  theta = 0.0f;
1286 
1287  return theta;
1288  }
1289 };
1290 
1293 class SPRK_API OperatorControl : public SprocketControl
1294 {
1295 public:
1297  explicit OperatorControl(View const & in_view);
1298 
1300  OperatorControl(OperatorControl const & in_that);
1301 
1305  OperatorControl(OperatorControl && in_that);
1306 
1310  OperatorControl & operator=(OperatorControl && in_that);
1311 
1313  ~OperatorControl();
1314 
1315  HPS::Type ObjectType() const {return HPS::Type::OperatorControl;};
1316 
1318  OperatorControl & operator=(OperatorControl const & in_that);
1319 
1320 
1322  size_t GetCount();
1323 
1326  size_t GetCount(Operator::Priority in_priority);
1327 
1328 
1334  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1335 
1342  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1343 
1347  bool Pop(Operator::Priority in_priority = Operator::Priority::Default);
1348 
1353  bool Pop(OperatorPtr & out_operator);
1354 
1360  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1361 
1362 
1368  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1369 
1376  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1377 
1383  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Default);
1384 
1391  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Default);
1392 
1393 
1397  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Default);
1398 
1402  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1403 
1406  OperatorControl & UnsetEverything();
1407 
1408 
1412  bool ShowTop(OperatorPtr & out_operator) const;
1413 
1418  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1419 
1423  bool Show(OperatorPtrArray & out_operators) const;
1424 
1429  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1430 
1431 private:
1433  OperatorControl() {}
1434 };
1435 
1442 {
1443 public:
1444 
1445  enum class Location
1446  {
1447  TopRight,
1448  TopLeft,
1449  BottomRight,
1450  BottomLeft,
1451  Custom,
1452  };
1453 
1455  explicit NavigationCubeControl(View const & in_view);
1456 
1459 
1464 
1468  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1469 
1472 
1473  HPS::Type ObjectType() const {return HPS::Type::NavigationCubeControl;};
1474 
1476  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1477 
1486  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1487 
1490  Location GetLocation() const;
1491 
1495  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1496 
1499  HPS::Rectangle GetPosition() const;
1500 
1504  NavigationCubeControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1505 
1508  HPS::IntRectangle GetPositionOffsets() const;
1509 
1514  NavigationCubeControl & SetVisibility(bool in_visibility);
1515 
1518  bool GetVisibility() const;
1519 
1523  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1524 
1527  bool GetTextVisibility() const;
1528 
1543  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1544 
1547  HPS::UTF8 GetMaterialPalette() const;
1548 
1556  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1557 
1558 
1561  bool GetInteractivity() const;
1562 
1567  NavigationCubeControl & SetSize(float in_size);
1568 
1571  float GetSize() const;
1572 
1575  HPS::SegmentKey GetSegmentKey() const;
1576 
1577 private:
1580 
1582  HPS::SegmentKey GetNavigationCubeSegment() const;
1583 };
1584 
1587 class SPRK_API AxisTriadControl : public SprocketControl
1588 {
1589 public:
1590 
1591  enum class Location
1592  {
1593  TopRight,
1594  TopLeft,
1595  BottomRight,
1596  BottomLeft,
1597  Custom,
1598  };
1599 
1601  explicit AxisTriadControl(View const & in_view);
1602 
1604  AxisTriadControl(AxisTriadControl const & in_that);
1605 
1609  AxisTriadControl(AxisTriadControl && in_that);
1610 
1614  AxisTriadControl & operator=(AxisTriadControl && in_that);
1615 
1617  ~AxisTriadControl();
1618 
1619  HPS::Type ObjectType() const {return HPS::Type::AxisTriadControl;};
1620 
1622  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1623 
1632  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_position = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1633 
1636  Location GetLocation() const;
1637 
1641  AxisTriadControl & SetPosition(HPS::Rectangle const & in_position);
1642 
1645  HPS::Rectangle GetPosition() const;
1646 
1650  AxisTriadControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1651 
1654  HPS::IntRectangle GetPositionOffsets() const;
1655 
1660  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1661 
1664  bool GetVisibility() const;
1665 
1669  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1670 
1673  bool GetTextVisibility() const;
1674 
1683  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1684 
1687  HPS::UTF8 GetMaterialPalette() const;
1688 
1695  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1696 
1699  bool GetInteractivity() const;
1700 
1705  AxisTriadControl & SetSize(float in_size);
1706 
1709  float GetSize() const;
1710 
1713  HPS::SegmentKey GetSegmentKey() const;
1714 
1715 private:
1717  AxisTriadControl(){};
1718 
1720  HPS::SegmentKey GetAxisTriadSegment() const;
1721 };
1722 
1724 class SPRK_API Component : public Sprocket
1725 {
1726 public:
1729  enum class ComponentType : uint32_t
1730  {
1731  None = 0x00000000,
1732  GenericMask = 0xfffff000,
1733 
1734  ExchangeComponentMask = 0x00001000,
1735  ExchangeModelFile = 0x00001001,
1736  ExchangeProductOccurrence = 0x00001002,
1737  ExchangePartDefinition = 0x00001003,
1738 
1739  ExchangeView = 0x00001004,
1740  ExchangeFilter = 0x00001005,
1741 
1742  ExchangeRepresentationItemMask = 0x00003000,
1743  ExchangeRIBRepModel = 0x00003001,
1744  ExchangeRICurve = 0x00003002,
1745  ExchangeRIDirection = 0x00003003,
1746  ExchangeRIPlane = 0x00003004,
1747  ExchangeRIPointSet = 0x00003005,
1748  ExchangeRIPolyBRepModel = 0x00003006,
1749  ExchangeRIPolyWire = 0x00003007,
1750  ExchangeRISet = 0x00003008,
1751  ExchangeRICoordinateSystem = 0x00003009,
1752 
1753  ExchangeTopologyMask = 0x00005000,
1754  ExchangeTopoBody = 0x00005001,
1755  ExchangeTopoConnex = 0x00005002,
1756  ExchangeTopoShell = 0x00005003,
1757  ExchangeTopoFace = 0x00005004,
1758  ExchangeTopoLoop = 0x00005005,
1759  ExchangeTopoCoEdge = 0x00005006,
1760  ExchangeTopoEdge = 0x00005007,
1761  ExchangeTopoVertex = 0x00005008,
1762  ExchangeTopoSingleWireBody = 0x00005009,
1763  ExchangeTopoWireEdge = 0x0000500a,
1764 
1765  ExchangeDrawingMask = 0x00009000,
1766  ExchangeDrawingModel = 0x00009001,
1767  ExchangeDrawingView = 0x00009002,
1768  ExchangeDrawingSheet = 0x00009003,
1769  ExchangeBasicDrawingBlock = 0x00009004,
1770  ExchangeOperatorDrawingBlock = 0x00009005,
1771 
1772  ExchangePMIMask = 0x00011000,
1773  ExchangePMI = ExchangePMIMask,
1774  ExchangePMIText = 0x00011100,
1775  ExchangePMIRichText = 0x00011200,
1776  ExchangePMIRoughness = 0x00011300,
1777  ExchangePMIGDT = 0x00011400,
1778  ExchangePMIDatum = 0x00011500,
1779  ExchangePMILineWelding = 0x00011600,
1780  ExchangePMISpotWelding = 0x00011700,
1781  ExchangePMIDimension = 0x00011800,
1782  ExchangePMIBalloon = 0x00011900,
1783  ExchangePMICoordinate = 0x00011a00,
1784  ExchangePMIFastener = 0x00011b00,
1785  ExchangePMILocator = 0x00011c00,
1786  ExchangePMIMeasurementPoint = 0x00011d00,
1787 
1788 
1789  ParasolidComponentMask = 0x00020000,
1790 
1791  ParasolidModelFile = 0x00020001,
1792  ParasolidAssembly = 0x00020002,
1793  ParasolidInstance = 0x00020003,
1794 
1795  ParasolidTopologyMask = 0x00060000,
1796  ParasolidTopoBody = 0x00060001,
1797  ParasolidTopoRegion = 0x00060002,
1798  ParasolidTopoShell = 0x00060003,
1799  ParasolidTopoFace = 0x00060004,
1800  ParasolidTopoLoop = 0x00060005,
1801  ParasolidTopoFin = 0x00060006,
1802  ParasolidTopoEdge = 0x00060007,
1803  ParasolidTopoVertex = 0x00060008,
1804 
1805 
1806  DWGComponentMask = 0x00100000,
1807  DWGModelFile = 0x00100001,
1808  DWGLayout = 0x00100002,
1809  DWGBlockTable = 0x00100003,
1810  DWGBlockTableRecord = 0x00100004,
1811  DWGEntity = 0x00100005,
1812  DWGLayerTable = 0x00100006,
1813  DWGLayer = 0x00100007,
1814 
1815 
1816  UserComponent = 0x01000000,
1817  };
1818 
1819 
1821  Component();
1822 
1825  Component(Component const & in_that);
1826 
1829  Component(Component && in_that);
1830 
1832  virtual ~Component();
1833 
1834  HPS::Type ObjectType() const { return HPS::Type::Component; }
1835 
1836 
1840  Component & operator=(Component const & in_that);
1841 
1845  Component & operator=(Component && in_that);
1846 
1850  virtual void Assign(Component const & in_that);
1851 
1855  bool Equals(Component const & in_that) const;
1856 
1860  bool operator!=(Component const & in_that) const;
1861 
1865  bool operator==(Component const & in_that) const;
1866 
1867 
1870  ComponentType GetComponentType() const;
1871 
1875  bool HasComponentType(ComponentType in_mask) const;
1876 
1877 
1878 
1884  void AddKey(Key const & in_key);
1885 
1888  KeyArray GetKeys() const;
1889 
1890 
1891 
1896  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1897 
1901  ComponentArray GetOwners() const;
1902 
1905  ComponentArray GetSubcomponents() const;
1906 
1911  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1912 
1913 
1914 
1917  void AddReference(Component & in_reference);
1918 
1921  ComponentArray GetReferrers() const;
1922 
1926  ComponentArray GetReferences() const;
1927 
1928 
1929 
1932  MetadataArray GetAllMetadata() const;
1933 
1937  Metadata GetMetadata(char const * in_name) const;
1938 
1942  UTF8 GetName() const;
1943 
1944 
1945 
1998  void Delete();
1999 
2003  void Flush();
2004 
2005 
2013  static KeyPathArray GetKeyPath(Component const & in_component);
2014 
2024  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
2025 
2034  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
2035 };
2036 
2038 class SPRK_API ComponentPath : public Sprocket
2039 {
2040 public:
2042  ComponentPath();
2043 
2046  ComponentPath(ComponentArray const & in_components);
2047 
2051  ComponentPath(size_t in_count, Component const in_components[]);
2052 
2054  ComponentPath(ComponentPath const & in_that);
2055 
2059  ComponentPath(ComponentPath && in_that);
2060 
2064  ComponentPath & operator=(ComponentPath && in_that);
2065 
2067  virtual ~ComponentPath();
2068 
2069  HPS::Type ObjectType() const { return HPS::Type::ComponentPath; }
2070 
2074  ComponentPath & operator+=(Component const & in_component);
2075 
2079  ComponentPath & operator+=(ComponentPath const & in_path);
2080 
2084  ComponentPath & operator+=(ComponentArray const & in_components);
2085 
2089  ComponentPath & Append(Component const & in_component);
2090 
2094  ComponentPath & Append(ComponentPath const & in_path);
2095 
2099  ComponentPath & Append(ComponentArray const & in_components);
2100 
2104  ComponentPath & operator=(ComponentPath const & in_that);
2105 
2109  ComponentPath & operator=(ComponentArray const & in_path);
2110 
2113  void Set(ComponentPath const & in_that);
2114 
2118  bool Equals(ComponentPath const & in_that) const;
2119 
2123  bool operator!= (ComponentPath const & in_that) const;
2124 
2128  bool operator== (ComponentPath const & in_that) const;
2129 
2130 
2134  ComponentPath & SetComponents(ComponentArray const & in_components);
2135 
2140  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
2141 
2144  ComponentArray GetComponents() const;
2145 
2149  KeyPathArray GetKeyPaths() const;
2150 
2155  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
2156 
2157 
2161  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
2162 
2167  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
2168 
2172  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2173 
2178  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2179 
2180 
2184  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2185 
2189  void Show(Canvas const & in_canvas, size_t in_layer = 0);
2190 
2196  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
2197 
2203  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
2204 
2211  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0);
2212 };
2213 
2214 
2219 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2220 {
2221  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2222 }
2223 
2228 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2229 {
2230  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2231 }
2232 
2237 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2238 {
2239  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2240 }
2241 
2246 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2247 {
2248  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2249 }
2250 
2255 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2256 {
2257  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2258 }
2259 
2264 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2265 {
2266  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2267 }
2268 
2273 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2274 {
2275  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2276 }
2277 
2282 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2283 {
2284  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2285 }
2286 
2291 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2292 {
2293  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2294 }
2295 
2296 
2298 class SPRK_API ComponentHighlightEvent : public Event
2299 {
2300 public:
2301  enum class Action
2302  {
2303  None = 0,
2304  Highlight,
2305  Unhighlight,
2306  };
2307 
2310  {
2311  channel = GetClassID();
2312  consumable = false;
2313  action = Action::None;
2314  }
2315 
2316  ComponentHighlightEvent(Action in_action,
2317  ComponentPath const & in_path = ComponentPath(),
2318  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2319  : Event(), action(in_action), path(in_path), options(in_options)
2320  {
2321  channel = GetClassID();
2322  consumable = false;
2323  }
2324 
2327  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2328  {
2329  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2330  {
2331  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2332  action = that.action;
2333  path = that.path;
2334  options = that.options;
2335  }
2336  else
2337  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2338  }
2339 
2341 
2344  Event * Clone() const
2345  {
2346  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2347  return new_event;
2348  }
2349 
2350  Action action;
2351  ComponentPath path;
2352  HighlightOptionsKit options;
2353 };
2354 
2355 
2357 class SPRK_API Filter : public Component
2358 {
2359 public:
2361  Filter();
2362 
2366  Filter(Component const & in_that);
2367 
2370  Filter(Filter const & in_that);
2371 
2374  Filter(Filter && in_that);
2375 
2376  virtual ~Filter();
2377 
2378  HPS::Type ObjectType() const { return HPS::Type::Filter; }
2379 
2380 
2381 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2382  Filter & operator=(Filter const & in_that) = default;
2383 #endif
2384 
2388  Filter & operator=(Filter && in_that);
2389 
2390 
2393  void Activate(View const & in_view);
2394 
2397  void Deactivate(View const & in_view);
2398 };
2399 
2400 
2401 class SPRK_API FilterActivationEvent : public Event
2402 {
2403 public:
2404  enum class Action
2405  {
2406  None = 0,
2407  Activate,
2408  Deactivate,
2409  };
2410 
2413  {
2414  channel = GetClassID();
2415  consumable = false;
2416  }
2417 
2418  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2419  {
2420  channel = GetClassID();
2421  consumable = false;
2422  }
2423 
2426  FilterActivationEvent(Event const & in_event) : Event(in_event)
2427  {
2428  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2429  {
2430  auto that = static_cast<FilterActivationEvent const &>(in_event);
2431  filter = that.filter;
2432  action = that.action;
2433  view = that.view;
2434  }
2435  else
2436  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2437  }
2438 
2440 
2443  Event * Clone() const
2444  {
2445  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2446  return new_event;
2447  }
2448 
2449  Filter filter;
2450  Action action;
2451  View view;
2452 };
2453 
2454 
2456 class SPRK_API Capture : public Component
2457 {
2458 public:
2460  Capture();
2461 
2465  Capture(Component const & in_that);
2466 
2469  Capture(Capture const & in_that);
2470 
2473  Capture(Capture && in_that);
2474 
2475  virtual ~Capture();
2476 
2477  HPS::Type ObjectType() const { return HPS::Type::Capture; }
2478 
2479 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2480  Capture & operator=(Capture const & in_that) = default;
2481 #endif
2482 
2486  Capture & operator=(Capture && in_that);
2487 
2488 
2492  View Activate();
2493 };
2494 
2495 
2496 class SPRK_API CaptureActivationEvent : public Event
2497 {
2498 public:
2501  {
2502  channel = GetClassID();
2503  consumable = false;
2504  }
2505 
2506  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2507  {
2508  channel = GetClassID();
2509  consumable = false;
2510  }
2511 
2514  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2515  {
2516  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2517  {
2518  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2519  capture = that.capture;
2520  view = that.view;
2521  }
2522  else
2523  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2524  }
2525 
2527 
2530  Event * Clone() const
2531  {
2532  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2533  return new_event;
2534  }
2535 
2536  Capture capture;
2537  View view;
2538 };
2539 
2540 
2542 class SPRK_API CADModel : public Component
2543 {
2544 public:
2546  CADModel();
2547 
2551  CADModel(Component const & in_that);
2552 
2555  CADModel(CADModel const & in_that);
2556 
2559  CADModel(CADModel && in_that);
2560 
2563  CADModel(Model const & in_that);
2564 
2565  virtual ~CADModel();
2566 
2567  HPS::Type ObjectType() const { return HPS::Type::CADModel; }
2568 
2569 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2570  CADModel & operator=(CADModel const & in_that) = default;
2571 #endif
2572 
2576  CADModel & operator=(CADModel && in_that);
2577 
2578 
2582  Component GetComponentFromKey(Key const & in_key) const;
2583 
2591  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2592 
2601  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2602 
2603 
2606  Model GetModel() const;
2607 
2610  FilterArray GetAllFilters() const;
2611 
2614  CaptureArray GetAllCaptures() const;
2615 
2619  FilterArray GetActiveFilters(View const & in_view) const;
2620 
2621 
2625  View ActivateDefaultCapture();
2626 
2627 
2635  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2636 };
2637 
2638 
2639 
2642 class SPRK_API Metadata : public Sprocket
2643 {
2644 public:
2646  Metadata();
2647 
2650  Metadata(Metadata const & in_that);
2651 
2654  Metadata(Metadata && in_that);
2655 
2658  Metadata(char const * in_name);
2659 
2660  virtual ~Metadata();
2661 
2662  HPS::Type ObjectType() const { return HPS::Type::Metadata; }
2663 
2664 
2668  Metadata & operator=(Metadata const & in_that);
2669 
2673  Metadata & operator=(Metadata && in_that);
2674 
2678  virtual void Assign(Metadata const & in_that);
2679 
2683  bool Equals(Metadata const & in_that) const;
2684 
2688  bool operator!=(Metadata const & in_that) const;
2689 
2693  bool operator==(Metadata const & in_that) const;
2694 
2695 
2698  HPS::UTF8 GetName() const;
2699 
2702  void SetName(char const * in_name);
2703 };
2704 
2706 class SPRK_API IntegerMetadata : public Metadata
2707 {
2708 public:
2710  IntegerMetadata();
2711 
2715  IntegerMetadata(Metadata const & in_that);
2716 
2719  IntegerMetadata(IntegerMetadata const & in_that);
2720 
2723  IntegerMetadata(IntegerMetadata && in_that);
2724 
2728  IntegerMetadata(char const * in_name, int in_value);
2729 
2730  virtual ~IntegerMetadata();
2731 
2732  HPS::Type ObjectType() const { return HPS::Type::IntegerMetadata; }
2733 
2734 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2735  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2736 #endif
2737 
2741  IntegerMetadata & operator=(IntegerMetadata && in_that);
2742 
2743 
2746  int GetValue() const;
2747 
2750  void SetValue(int in_value);
2751 };
2752 
2754 class SPRK_API UnsignedIntegerMetadata : public Metadata
2755 {
2756 public:
2759 
2763  UnsignedIntegerMetadata(Metadata const & in_that);
2764 
2768 
2772 
2776  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2777 
2778  virtual ~UnsignedIntegerMetadata();
2779 
2780  HPS::Type ObjectType() const { return HPS::Type::UnsignedIntegerMetadata; }
2781 
2782 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2783  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2784 #endif
2785 
2789  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2790 
2791 
2794  unsigned int GetValue() const;
2795 
2798  void SetValue(unsigned int in_value);
2799 };
2800 
2802 class SPRK_API DoubleMetadata : public Metadata
2803 {
2804 public:
2806  DoubleMetadata();
2807 
2811  DoubleMetadata(Metadata const & in_that);
2812 
2815  DoubleMetadata(DoubleMetadata const & in_that);
2816 
2819  DoubleMetadata(DoubleMetadata && in_that);
2820 
2824  DoubleMetadata(char const * in_name, double in_value);
2825 
2826  virtual ~DoubleMetadata();
2827 
2828  HPS::Type ObjectType() const { return HPS::Type::DoubleMetadata; }
2829 
2830 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2831  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2832 #endif
2833 
2837  DoubleMetadata & operator=(DoubleMetadata && in_that);
2838 
2839 
2842  double GetValue() const;
2843 
2846  void SetValue(double in_value);
2847 };
2848 
2850 class SPRK_API StringMetadata : public Metadata
2851 {
2852 public:
2854  StringMetadata();
2855 
2859  StringMetadata(Metadata const & in_that);
2860 
2863  StringMetadata(StringMetadata const & in_that);
2864 
2867  StringMetadata(StringMetadata && in_that);
2868 
2872  StringMetadata(char const * in_name, char const * in_value);
2873 
2874  virtual ~StringMetadata();
2875 
2876  HPS::Type ObjectType() const { return HPS::Type::StringMetadata; }
2877 
2878 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2879  StringMetadata & operator=(StringMetadata const & in_that) = default;
2880 #endif
2881 
2885  StringMetadata & operator=(StringMetadata && in_that);
2886 
2887 
2890  UTF8 GetValue() const;
2891 
2894  void SetValue(char const * in_value);
2895 };
2896 
2898 class SPRK_API TimeMetadata : public Metadata
2899 {
2900 public:
2902  TimeMetadata();
2903 
2907  TimeMetadata(Metadata const & in_that);
2908 
2911  TimeMetadata(TimeMetadata const & in_that);
2912 
2915  TimeMetadata(TimeMetadata && in_that);
2916 
2920  TimeMetadata(char const * in_name, unsigned int in_value);
2921 
2922  virtual ~TimeMetadata();
2923 
2924  HPS::Type ObjectType() const { return HPS::Type::TimeMetadata; }
2925 
2926 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2927  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
2928 #endif
2929 
2933  TimeMetadata & operator=(TimeMetadata && in_that);
2934 
2935 
2938  unsigned int GetValue() const;
2939 
2942  HPS::UTF8 GetValueAsString() const;
2943 
2946  void SetValue(unsigned int in_value);
2947 };
2948 
2949 
2951 class SPRK_API BooleanMetadata : public Metadata
2952 {
2953 public:
2955  BooleanMetadata();
2956 
2960  BooleanMetadata(Metadata const & in_that);
2961 
2964  BooleanMetadata(BooleanMetadata const & in_that);
2965 
2968  BooleanMetadata(BooleanMetadata && in_that);
2969 
2973  BooleanMetadata(char const * in_name, bool in_value);
2974 
2975  virtual ~BooleanMetadata();
2976 
2977  HPS::Type ObjectType() const { return HPS::Type::BooleanMetadata; }
2978 
2979 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2980  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
2981 #endif
2982 
2986  BooleanMetadata & operator=(BooleanMetadata && in_that);
2987 
2988 
2991  bool GetValue() const;
2992 
2995  void SetValue(bool in_value);
2996 };
2997 
2998 
2999 
3001 class SPRK_API Factory : public Sprocket
3002 {
3003 public:
3004 
3007  static CanvasArray GetCanvases();
3008 
3011  static LayoutArray GetLayouts();
3012 
3015  static ViewArray GetViews();
3016 
3019  static ModelArray GetModels();
3020 
3023  static CADModelArray GetCADModels();
3024 
3030  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
3031 
3036  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
3037 
3043  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
3044 
3048  static Layout CreateLayout(char const * in_name = "");
3049 
3053  static View CreateView(char const * in_name = "");
3054 
3058  static Model CreateModel(char const * in_name = "");
3059 
3060  static Component CreateComponent(HPS::Component const & in_owner, char const * in_name = "");
3061 
3062 private:
3063  Factory() {}
3064 };
3065 
3075 class SPRK_API AxisTriadOperator : public Operator
3076 {
3077 public:
3078  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3080  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
3081 
3087  virtual bool OnMouseDown(MouseState const & in_state);
3092  virtual bool OnMouseUp(MouseState const & in_state);
3097  virtual bool OnMouseMove(MouseState const & in_state);
3098 
3103  virtual bool OnTouchDown(TouchState const & in_state);
3108  virtual bool OnTouchUp(TouchState const & in_state);
3113  virtual bool OnTouchMove(TouchState const & in_state);
3114 
3115  virtual void OnViewAttached();
3116 
3117 private:
3118 
3119  bool AxisOrbit(HPS::WindowPoint const & in_loc);
3120  void Transition(HPS::SelectionResults selection_results);
3121  void TranslatePoint(HPS::WindowPoint * point);
3122  bool IsEventRelevant(HPS::Point const & event_location);
3123 
3124  bool operator_active;
3125  HPS::WindowPoint start_point;
3126  HPS::Vector start_sphere_point;
3127  float axis_subwindow_width;
3128  float axis_subwindow_height;
3129  HPS::TouchID tracked_touch_ID;
3130  HPS::Rectangle axis_subwindow;
3131  HPS::IntRectangle axis_subwindow_offsets;
3132  HPS::SegmentKey axis_triad_segment;
3133 
3134 };
3135 
3138 {
3139 public:
3142  virtual ~SmoothTransitionCompleteEvent();
3143 
3146  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
3147  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
3148 
3151  SmoothTransitionCompleteEvent(Event const & in_event) : Event(in_event)
3152  {
3153  if (in_event.GetChannel() == Object::ClassID<SmoothTransitionCompleteEvent>())
3154  {
3155  auto that = static_cast<SmoothTransitionCompleteEvent const &>(in_event);
3156  view = that.view;
3157  }
3158  else
3159  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3160  }
3161 
3164  Event * Clone() const
3165  {
3167  return new_event;
3168  }
3169 
3173  virtual bool Drop(Event const * in_that_event) const
3174  {
3175  HPS_UNREFERENCED(in_that_event);
3176  return false;
3177  }
3178 
3179  HPS::View view;
3180 };
3181 
3200 class SPRK_API NavigationCubeOperator : public Operator
3201 {
3202 public:
3203  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3204  ~NavigationCubeOperator() { }
3205 
3207  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3208 
3213  virtual bool OnMouseDown(MouseState const & in_state);
3218  virtual bool OnMouseUp(MouseState const & in_state);
3223  virtual bool OnMouseMove(MouseState const & in_state);
3224 
3228  virtual bool OnTouchDown(TouchState const & in_state);
3233  virtual bool OnTouchUp(TouchState const & in_state);
3238  virtual bool OnTouchMove(TouchState const & in_state);
3239 
3240  virtual void OnViewAttached();
3241  virtual void OnViewDetached();
3242 
3243  virtual void OnModelAttached();
3244 
3245  void UpdateHighlightColor();
3246 
3251  void SetReferenceSegment(HPS::KeyPath const & in_path_to_segment);
3252 
3257  void SetReferenceSegment(HPS::KeyPathArray const & in_path_to_segments);
3258 
3262  HPS::KeyPathArray ShowReferenceSegment();
3263 
3264 private:
3265  void Transition(HPS::SelectionResults const & selection_results);
3266  bool Orbit(HPS::WindowPoint const & in_loc);
3267  void TranslatePoint(HPS::WindowPoint * point);
3268  bool IsEventRelevant(HPS::Point const & event_location, HPS::KeyPath const & event_path);
3269  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3270 
3271  bool operator_active;
3272  HPS::TouchID tracked_touch_ID;
3273  HPS::WindowPoint start_point;
3274  HPS::WindowPoint down_position;
3275  HPS::Vector start_sphere_point;
3276  HPS::KeyPathArray reference_segments; //rotation and zooming happen around these segments
3277 
3278  HPS::SegmentKey nav_cube_segment;
3279  HPS::SegmentKey style_segment;
3280  HPS::PortfolioKey portfolio;
3281  HPS::ReferenceKeyArrayArray groups;
3282  HPS::HighlightOptionsKit highlight_options_kit;
3283  HPS::CameraKit previous_camera;
3284  int previous_face;
3285  bool suppress_mouse_over_highlights;
3286 
3287  HPS::Rectangle nav_cube_subwindow;
3288  HPS::IntRectangle nav_cube_subwindow_offsets;
3289  float nav_cube_subwindow_width;
3290  float nav_cube_subwindow_height;
3291 
3292  int highlighted_group;
3293 
3294  bool moving;
3295 
3296  class SmoothTransitionCompleteEventHandler : public EventHandler
3297  {
3298  public:
3299  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3300  : handler_view(in_view), handler_moving(&in_moving) {}
3301 
3302  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3303 
3304  virtual HandleResult Handle(HPS::Event const * in_event);
3305 
3306  private:
3307  View handler_view;
3308  bool * handler_moving;
3309  };
3310 
3311  SmoothTransitionCompleteEventHandler * handler;
3312 };
3313 
3314 
3315 
3316 
3317 class SceneTreeItem;
3318 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3319 class SceneTree;
3320 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3321 
3324 class SPRK_API SceneTree : public Sprocket
3325 {
3326 public:
3329  enum class ItemType : uint32_t
3330  {
3331  None = 0x00000000,
3332  GenericMask = 0xffff0000,
3333 
3334  Segment = 0x00000001,
3335  Include = 0x00000002,
3336  ConditionalExpression = 0x00000003,
3337  StaticModelSegment = 0x00000004,
3338  AttributeFilter = 0x00000005,
3339 
3340  Geometry = 0x00010000,
3341  CuttingSection = 0x00010001,
3342  Shell = 0x00010002,
3343  Mesh = 0x00010003,
3344  Grid = 0x00010004,
3345  NURBSSurface = 0x00010005,
3346  Cylinder = 0x00010006,
3347  Sphere = 0x00010007,
3348  Polygon = 0x00010008,
3349  Circle = 0x00010009,
3350  CircularWedge = 0x0001000a,
3351  Ellipse = 0x0001000b,
3352  Line = 0x0001000c,
3353  NURBSCurve = 0x0001000d,
3354  CircularArc = 0x0001000e,
3355  EllipticalArc = 0x0001000f,
3356  InfiniteLine = 0x00010010,
3357  InfiniteRay = 0x00010011,
3358  Marker = 0x00010012,
3359  Text = 0x00010013,
3360  Reference = 0x00010014,
3361  DistantLight = 0x00010015,
3362  Spotlight = 0x00010016,
3363 
3364  Attribute = 0x00020000,
3365  Portfolio = 0x00020001,
3366  SegmentStyle = 0x00020002,
3367  NamedStyle = 0x00020003,
3368  MaterialPalette = 0x00020004,
3369  Priority = 0x00020005,
3370  Material = 0x00020006,
3371  Camera = 0x00020007,
3372  ModellingMatrix = 0x00020008,
3373  UserData = 0x00020009,
3374  TextureMatrix = 0x0002000a,
3375  Culling = 0x0002000b,
3376  CurveAttribute = 0x0002000c,
3377  CylinderAttribute = 0x0002000d,
3378  EdgeAttribute = 0x0002000e,
3379  LightingAttribute = 0x0002000f,
3380  LineAttribute = 0x00020010,
3381  MarkerAttribute = 0x00020011,
3382  SurfaceAttribute = 0x00020012,
3383  Selectability = 0x00020013,
3384  SphereAttribute = 0x00020014,
3385  Subwindow = 0x00020015,
3386  TextAttribute = 0x00020016,
3387  Transparency = 0x00020017,
3388  Visibility = 0x00020018,
3389  VisualEffects = 0x00020019,
3390  Performance = 0x00020020,
3391  DrawingAttribute = 0x00020021,
3392  HiddenLineAttribute = 0x00020022,
3393  ContourLine = 0x00020023,
3394  Condition = 0x00020024,
3395  Bounding = 0x00020025,
3396  AttributeLock = 0x00020026,
3397  TransformMask = 0x00020027,
3398  ColorInterpolation = 0x00020028,
3399  CuttingSectionAttribute = 0x00020029,
3400 
3401  // window only attributes
3402  Debugging = 0x00020030,
3403  PostProcessEffects = 0x00020031,
3404  SelectionOptions = 0x00020032,
3405  UpdateOptions = 0x00020033,
3406 
3407  Definition = 0x00040000,
3408  NamedStyleDefinition = 0x00040001,
3409  TextureDefinition = 0x00040002,
3410  LinePatternDefinition = 0x00040003,
3411  GlyphDefinition = 0x00040004,
3412  CubeMapDefinition = 0x00040005,
3413  ImageDefinition = 0x00040006,
3414  MaterialPaletteDefinition = 0x00040007,
3415  ShaderDefinition = 0x00040008,
3416  ShapeDefinition = 0x00040009,
3417 
3418  Group = 0x00080000,
3419  SegmentGroup = 0x00080100,
3420  GeometryGroup = 0x00080200,
3421  AttributeGroup = 0x00080300,
3422  PortfolioGroup = 0x00080400,
3423  StyleGroup = 0x00080500,
3424  IncludeGroup = 0x00080600,
3425  DefinitionGroup = 0x00180000,
3426  NamedStyleDefinitionGroup = 0x00180700,
3427  TextureDefinitionGroup = 0x00180800,
3428  LinePatternDefinitionGroup = 0x00180900,
3429  GlyphDefinitionGroup = 0x00180a00,
3430  CubeMapDefinitionGroup = 0x00180b00,
3431  ImageDefinitionGroup = 0x00180c00,
3432  MaterialPaletteDefinitionGroup = 0x00180d00,
3433  ShaderDefinitionGroup = 0x00180e00,
3434  ShapeDefinitionGroup = 0x00180f00,
3435  CuttingSectionGroup = 0x00080001,
3436  ShellGroup = 0x00080002,
3437  MeshGroup = 0x00080003,
3438  GridGroup = 0x00080004,
3439  NURBSSurfaceGroup = 0x00080005,
3440  CylinderGroup = 0x00080006,
3441  SphereGroup = 0x00080007,
3442  PolygonGroup = 0x00080008,
3443  CircleGroup = 0x00080009,
3444  CircularWedgeGroup = 0x0008000a,
3445  EllipseGroup = 0x0008000b,
3446  LineGroup = 0x0008000c,
3447  NURBSCurveGroup = 0x0008000d,
3448  CircularArcGroup = 0x0008000e,
3449  EllipticalArcGroup = 0x0008000f,
3450  InfiniteLineGroup = 0x00080010,
3451  InfiniteRayGroup = 0x00080011,
3452  MarkerGroup = 0x00080012,
3453  TextGroup = 0x00080013,
3454  ReferenceGroup = 0x00080014,
3455  DistantLightGroup = 0x00080015,
3456  SpotlightGroup = 0x00080016,
3457  };
3458 
3460  SceneTree();
3461 
3464  SceneTree(Canvas const & in_canvas);
3465 
3468  SceneTree(SceneTree const & in_that);
3469 
3472  SceneTree(SceneTree && in_that);
3473 
3474  virtual ~SceneTree();
3475 
3476  virtual HPS::Type ObjectType() const { return HPS::Type::SceneTree; }
3477 
3481  SceneTree & operator=(SceneTree const & in_that);
3482 
3486  SceneTree & operator=(SceneTree && in_that);
3487 
3491  virtual void Assign(SceneTree const & in_that);
3492 
3496  bool Equals(SceneTree const & in_that) const;
3497 
3501  bool operator!=(SceneTree const & in_that) const;
3502 
3506  bool operator==(SceneTree const & in_that) const;
3507 
3508 
3517  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3518 
3528  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3529 
3540  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3541 
3549  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3550 
3553  HighlightOptionsKitArray GetHighlightOptions() const;
3554 
3555 
3560  void SetGroupingLimit(size_t in_limit);
3561 
3564  size_t GetGroupingLimit() const;
3565 
3566 
3573  void SetRoot(SceneTreeItemPtr const & in_root);
3574 
3577  SceneTreeItemPtr GetRoot() const;
3578 
3579 
3582  virtual void Flush();
3583 
3588  void SetHighlightEventHandling(bool in_state);
3589 
3593  bool GetHighlightEventHandling() const;
3594 
3597  void ReExpand();
3598 };
3599 
3600 
3603 class SPRK_API SceneTreeItem : public Sprocket
3604 {
3605 public:
3607  SceneTreeItem();
3608 
3611  SceneTreeItem(SceneTreeItem const & in_that);
3612 
3615  SceneTreeItem(SceneTreeItem && in_that);
3616 
3622  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3623 
3629  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3630 
3636  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3637 
3643  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3644 
3652  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3653 
3654  virtual ~SceneTreeItem();
3655 
3656  HPS::Type ObjectType() const { return HPS::Type::SceneTreeItem; }
3657 
3661  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3662 
3666  SceneTreeItem & operator=(SceneTreeItem && in_that);
3667 
3671  virtual void Assign(SceneTreeItem const & in_that);
3672 
3676  bool Equals(SceneTreeItem const & in_that) const;
3677 
3681  bool operator!=(SceneTreeItem const & in_that) const;
3682 
3686  bool operator==(SceneTreeItem const & in_that) const;
3687 
3688 
3691  SceneTreePtr GetTree() const;
3692 
3695  UTF8 GetTitle() const;
3696 
3699  SceneTree::ItemType GetItemType() const;
3700 
3704  bool HasItemType(SceneTree::ItemType in_mask) const;
3705 
3708  Key GetKey() const;
3709 
3712  KeyPath GetKeyPath() const;
3713 
3716  bool HasChildren() const;
3717 
3718 
3727  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3728 
3729 
3732  virtual void Expand();
3733 
3736  virtual void Collapse();
3737 
3738 
3743  bool IsSelected() const;
3744 
3750  virtual void Select();
3751 
3757  virtual void Unselect();
3758 
3763  bool IsHighlightable() const;
3764 
3770  bool IsHighlighted() const;
3771 
3776  void Highlight(size_t in_highlight_options_index = 0);
3777 
3783  void Highlight(HighlightOptionsKit const & in_highlight_options);
3784 
3790  void Unhighlight(size_t in_highlight_options_index = 0);
3791 
3798  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3799 
3802  bool IsExpanded() const;
3803 
3806  void ReExpand();
3807 };
3808 
3809 
3810 
3811 class ComponentTreeItem;
3812 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3813 class ComponentTree;
3814 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3815 
3818 class SPRK_API ComponentTree : public Sprocket
3819 {
3820 public:
3823  enum class ItemType
3824  {
3825  None,
3826  ExchangeComponent,
3827  ExchangeModelFile,
3828 
3829  ExchangeViewGroup,
3830  ExchangeAnnotationViewGroup,
3831  ExchangePMIGroup,
3832  ExchangeModelGroup,
3833 
3834  ParasolidComponent,
3835  ParasolidModelFile,
3836 
3837  DWGComponent,
3838  DWGModelFile,
3839  };
3840 
3842  ComponentTree();
3843 
3847  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3848 
3851  ComponentTree(ComponentTree const & in_that);
3852 
3855  ComponentTree(ComponentTree && in_that);
3856 
3857  virtual ~ComponentTree();
3858 
3859  virtual HPS::Type ObjectType() const { return HPS::Type::ComponentTree; }
3860 
3864  ComponentTree & operator=(ComponentTree const & in_that);
3865 
3869  ComponentTree & operator=(ComponentTree && in_that);
3870 
3874  virtual void Assign(ComponentTree const & in_that);
3875 
3879  bool Equals(ComponentTree const & in_that) const;
3880 
3884  bool operator!=(ComponentTree const & in_that) const;
3885 
3889  bool operator==(ComponentTree const & in_that) const;
3890 
3891 
3900  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3901 
3911  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3912 
3923  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3924 
3934  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3935 
3938  HighlightOptionsKitArray GetHighlightOptions() const;
3939 
3940 
3947  void SetRoot(ComponentTreeItemPtr const & in_root);
3948 
3951  ComponentTreeItemPtr GetRoot() const;
3952 
3953 
3956  virtual void Flush();
3957 
3960  void ReExpand();
3961 
3966  void SetHighlightEventHandling(bool in_state);
3967 
3971  bool GetHighlightEventHandling() const;
3972 };
3973 
3974 
3977 class SPRK_API ComponentTreeItem : public Sprocket
3978 {
3979 public:
3982 
3985  ComponentTreeItem(ComponentTreeItem const & in_that);
3986 
3990 
3996  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
3997 
4004  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
4005 
4006  virtual ~ComponentTreeItem();
4007 
4008  HPS::Type ObjectType() const { return HPS::Type::ComponentTreeItem; }
4009 
4013  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
4014 
4018  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
4019 
4023  virtual void Assign(ComponentTreeItem const & in_that);
4024 
4028  bool Equals(ComponentTreeItem const & in_that) const;
4029 
4033  bool operator!=(ComponentTreeItem const & in_that) const;
4034 
4038  bool operator==(ComponentTreeItem const & in_that) const;
4039 
4040 
4041 
4044  ComponentTreePtr GetTree() const;
4045 
4048  UTF8 GetTitle() const;
4049 
4052  ComponentTree::ItemType GetItemType() const;
4053 
4056  Component GetComponent() const;
4057 
4060  bool HasChildren() const;
4061 
4064  ComponentPath GetPath() const;
4065 
4066 
4074  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
4075 
4076 
4079  virtual void Expand();
4080 
4083  virtual void Collapse();
4084 
4085 
4091  bool IsHighlighted() const;
4092 
4097  virtual void OnHighlight(HighlightOptionsKit const & in_options);
4098 
4103  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
4104 
4105 
4110  void Highlight(size_t in_highlight_options_index = 0);
4111 
4117  void Highlight(HighlightOptionsKit const & in_highlight_options);
4118 
4123  void Unhighlight(size_t in_highlight_options_index = 0);
4124 
4130  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
4131 
4132 
4142  bool IsHidden() const;
4143 
4147  virtual void OnHide();
4148 
4152  virtual void OnShow();
4153 
4157  void Hide();
4158 
4162  void Show();
4163 
4168  void Isolate();
4169 
4172  bool IsExpanded() const;
4173 
4176  void ReExpand();
4177 };
4178 
4179 
4180 
4181 
4182 }
4183 #endif
4184 
4185 
4186 
Definition: sprk.h:2898
HPS::Type ObjectType() const
Definition: sprk.h:2732
Definition: hps.h:3367
Definition: hps.h:6109
Definition: sprk.h:992
HPS::Type ObjectType() const
Definition: sprk.h:480
Event * Clone() const
Definition: sprk.h:745
Definition: sprk.h:3075
Definition: sprk.h:264
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2327
HPS::Type ObjectType() const
Definition: sprk.h:272
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1189
Definition: hps.h:41860
ComponentHighlightEvent()
Definition: sprk.h:2309
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1215
Definition: hps.h:477
CameraChangedEvent(Event const &in_event)
Definition: sprk.h:1011
HPS::Type ObjectType() const
Definition: sprk.h:210
HPS::Type ObjectType() const
Definition: sprk.h:1101
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1174
HPS::Type ObjectType() const
Definition: sprk.h:2378
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5727
Location
Definition: sprk.h:1445
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1218
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1179
ItemType
Definition: sprk.h:3823
Definition: hps.h:5767
virtual intptr_t Freshen() const
Definition: sprk.h:1034
CaptureActivationEvent()
Definition: sprk.h:2500
Definition: sprk.h:66
Definition: sprk.h:207
Definition: sprk.h:667
Definition: sprk.h:100
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1139
Definition: sprk.h:3977
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1149
Definition: sprk.h:2951
HPS::Type ObjectType() const
Definition: sprk.h:2567
Definition: hps.h:41647
Definition: hps.h:1326
Definition: hps.h:1044
HPS::Type ObjectType() const
Definition: sprk.h:2069
Definition: hps.h:1709
Definition: sprk.h:234
ModelDeletedEvent()
Definition: sprk.h:953
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:3146
std::vector< KeyPath, Allocator< KeyPath > > KeyPathArray
Array of type HPS::KeyPath.
Definition: hps.h:6573
Definition: sprk.h:3818
Definition: hps.h:47100
Definition: sprk.h:1052
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1164
Definition: hps.h:7607
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1210
virtual HPS::Type ObjectType() const
Definition: sprk.h:3476
Definition: hps.h:3518
Definition: hps.h:2075
Definition: sprk.h:904
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:789
Definition: sprk.h:755
Definition: hps.h:1404
Definition: hps.h:865
HPS::Type ObjectType() const
Definition: sprk.h:1619
Definition: hps.h:41765
virtual void OnModelDetached()
Definition: sprk.h:1203
SmoothTransitionCompleteEvent(Event const &in_event)
Definition: sprk.h:3151
Definition: hps.h:1767
Definition: hps.h:1533
Definition: hps.h:8780
Definition: hps.h:251
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1206
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1827
Event * Clone() const
Definition: sprk.h:895
CameraChangedEvent()
Definition: sprk.h:996
SprocketKit & operator=(SprocketKit &&in_that)
Definition: sprk.h:254
Definition: hps.h:46999
Definition: hps.h:40708
Definition: sprk.h:1441
Definition: sprk.h:949
Definition: sprk.h:552
HPS::Type ObjectType() const
Definition: sprk.h:107
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:831
virtual void OnViewDetached()
Definition: sprk.h:1195
Definition: hps.h:40754
HPS::Type ObjectType() const
Definition: sprk.h:3656
LayoutDeletedEvent()
Definition: sprk.h:759
Event * Clone() const
Definition: sprk.h:939
virtual void OnViewAttached()
Definition: sprk.h:1192
Definition: hps.h:40142
Definition: hps.h:43334
Definition: hps.h:1084
Definition: sprk.h:2642
LayoutDetachedEvent()
Definition: sprk.h:714
Definition: sprk.h:2754
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1154
Definition: hps.h:9593
Definition: hps.h:41808
Definition: hps.h:1492
SmoothTransitionCompleteEvent()
Definition: sprk.h:3141
Definition: hps.h:1424
HPS::Type ObjectType() const
Definition: sprk.h:559
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1134
FilterActivationEvent()
Definition: sprk.h:2412
Definition: hps.h:1443
virtual void OnModelAttached()
Definition: sprk.h:1199
Definition: hps.h:37920
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2426
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:923
HPS::Type ObjectType() const
Definition: sprk.h:1473
HPS::Type ObjectType() const
Definition: sprk.h:1834
Definition: hps.h:6980
Location
Definition: sprk.h:1591
HPS::Type ObjectType() const
Definition: sprk.h:237
Definition: hps.h:46491
Definition: sprk.h:2706
Definition: sprk.h:1587
Definition: hps.h:43511
HPS::Type ObjectType() const
Definition: sprk.h:1315
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:227
Definition: hps.h:45398
virtual UTF8 GetName() const
Definition: sprk.h:1124
Definition: hps.h:46887
Definition: sprk.h:710
Event * Clone() const
Definition: sprk.h:2443
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2514
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1159
HPS::Type ObjectType() const
Definition: sprk.h:2828
CanvasDeletedEvent()
Definition: sprk.h:671
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1144
HPS::Type ObjectType() const
Definition: sprk.h:2662
HPS::Type ObjectType() const
Definition: sprk.h:2780
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:222
Event * Clone() const
Definition: sprk.h:2530
Definition: hps.h:15232
ViewDeletedEvent()
Definition: sprk.h:865
intptr_t GetChannel() const
Definition: hps.h:6226
Definition: sprk.h:798
SprocketKit(SprocketKit &&in_that)
Definition: sprk.h:249
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:3173
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3080
Definition: sprk.h:1724
Definition: hps.h:43788
Definition: hps.h:46010
virtual bool OnTextInput(HPS::UTF8 const &in_text)
Definition: sprk.h:1184
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:880
Definition: hps.h:37484
Definition: sprk.h:2850
ViewDetachedEvent()
Definition: sprk.h:809
Definition: hps.h:6193
Definition: sprk.h:1293
Definition: hps.h:413
HPS::Type ObjectType() const
Definition: sprk.h:2876
Event * Clone() const
Definition: sprk.h:2344
Definition: sprk.h:473
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:686
Definition: sprk.h:3200
Definition: sprk.h:2038
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:1024
ComponentType
Definition: sprk.h:1729
Definition: hps.h:45324
std::vector< Key, Allocator< Key > > KeyArray
Array of type HPS::Key.
Definition: hps.h:6545
Definition: hps.h:2094
Definition: sprk.h:2298
Event * Clone() const
Definition: sprk.h:701
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:729
HPS::Type ObjectType() const
Definition: sprk.h:4008
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1129
ItemType
Definition: sprk.h:3329
Definition: sprk.h:2357
Definition: sprk.h:3001
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3207
Definition: sprk.h:184
Definition: sprk.h:3137
Definition: hps.h:432
Event * Clone() const
Definition: sprk.h:983
Definition: sprk.h:2456
Definition: hps.h:2114
ModelDetachedEvent()
Definition: sprk.h:908
static MouseButtons ButtonLeft()
Definition: hps.h:46609
virtual HPS::Type ObjectType() const
Definition: sprk.h:3859
Definition: sprk.h:3324
Definition: sprk.h:2802
UpdateType
Definition: hps.h:185
Definition: hps.h:8930
HPS::Type ObjectType() const
Definition: sprk.h:1062
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1221
Definition: hps.h:7526
Definition: sprk.h:2401
Definition: hps.h:37100
Definition: hps.h:358
Event * Clone() const
Definition: sprk.h:3164
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:968
Event * Clone() const
Definition: sprk.h:849
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:774
Definition: hps.h:9150
Definition: hps.h:10694
Definition: sprk.h:1236
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1169
Definition: sprk.h:3603
Definition: sprk.h:2542
Definition: hps.h:42334
Mode
Definition: sprk.h:189
Definition: hps.h:518
Definition: sprk.h:1093
Definition: hps.h:1127
Definition: hps.h:41692
Definition: sprk.h:861
Definition: sprk.h:2496
Definition: hps.h:40205
HPS::Type ObjectType() const
Definition: sprk.h:2924
HPS::Type ObjectType() const
Definition: sprk.h:2477
HPS::Type ObjectType() const
Definition: sprk.h:2977
Definition: hps.h:7238
Event * Clone() const
Definition: sprk.h:1041