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 SPROCKETS
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(SPROCKETS)
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 
78  enum class UpdateType
79  {
80  Synchronous,
81  Asynchronous
82  };
83 };
84 
85 typedef std::shared_ptr<Operator> OperatorPtr;
86 
87 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
88 
89 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
90 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
91 typedef std::vector<View, Allocator<View> > ViewArray;
92 typedef std::vector<Model, Allocator<Model> > ModelArray;
93 
94 typedef std::vector<Component, Allocator<Component> > ComponentArray;
95 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
96 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
97 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
98 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
99 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
100 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
101 
102 
106 class SPRK_API Canvas : public Sprocket
107 {
108 public:
109  Canvas();
110  Canvas(Canvas const & that);
111  ~Canvas();
112 
113  HPS::Type ObjectType() const { return HPS::Type::Canvas; }
114 
116  void Delete();
117 
118  Canvas & operator=(Canvas const & in_that);
119  void Assign(Canvas const & in_that);
120 
121  bool Equals(Canvas const & in_that) const;
122  bool operator!= (Canvas const & in_that) const;
123  bool operator== (Canvas const & in_that) const;
124 
126  UTF8 GetName() const;
127 
131  void AttachLayout(Layout const & in_layout);
132 
136  void AttachViewAsLayout(View const & in_view);
137 
139  void DetachLayout();
140 
142  Layout GetAttachedLayout() const;
143 
145  IncludeKey GetAttachedLayoutIncludeLink() const;
146 
148  View GetFrontView() const;
149 
150  WindowKey const GetWindowKey() const;
151 
154  WindowKey GetWindowKey();
155 
156  PortfolioKey const GetPortfolioKey() const;
157 
159  PortfolioKey GetPortfolioKey();
160 
162  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
163 
166  UpdateNotifier UpdateWithNotifier() const;
167 
171  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit = -1.) const;
172 
177  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit = -1.) const;
178 
182  void SetFrameRate(float in_frame_rate=20);
183 
187  float GetFrameRate() const;
188 };
189 
190 class SPRK_API Rendering
191 {
192 public:
195  enum class Mode
196  {
197  Gouraud,
198  GouraudWithLines,
199  Flat,
200  FlatWithLines,
201  Phong,
202  PhongWithLines,
203  HiddenLine,
204  FastHiddenLine,
205  Wireframe,
206  Default = Phong
207  };
208 
209 private:
210  Rendering() {}
211 };
212 
213 class SPRK_API SprocketControl : public Sprocket
214 {
215 public:
216  HPS::Type ObjectType() const {return HPS::Type::SprocketControl;}
217 
218 #if !defined(_MSC_VER) || _MSC_VER >= 1900
219  SprocketControl(HPS::SprocketControl const & in_that) = default;
220 #endif
221 
222 protected:
223  SprocketControl() {}
224 
228  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
229 
234  {
235  this->Object::operator=(std::move(in_that));
236  return *this;
237  }
238 };
239 
243 class SPRK_API View : public Sprocket
244 {
245 public:
246  View();
247  View(View const & that);
248  explicit View(SprocketControl const & in_ctrl);
249  ~View();
250 
251  HPS::Type ObjectType() const { return HPS::Type::View; }
252 
254  void Delete();
255 
256  View & operator=(View const & in_that);
257  void Assign(View const & in_that);
258 
259  bool Equals(View const & in_that) const;
260  bool operator!= (View const & in_that) const;
261  bool operator== (View const & in_that) const;
262 
264  UTF8 GetName() const;
265 
266 
268  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
269 
272  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
273 
274 
277  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
278 
283  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
284 
285 
290  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
291 
292 
294  HPS::View & FitWorld();
295 
298  HPS::View & FitWorld(SegmentKey const & in_segment);
299 
300 
303  HPS::View & FitWorld(BoundingKit const & in_bounding);
304 
309  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
310 
311 
316  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
317 
322  void AttachModel(Model const & in_model);
323 
325  void DetachModel();
326 
328  Model GetAttachedModel() const;
329 
331  IncludeKey GetAttachedModelIncludeLink() const;
332 
336  void SetRenderingMode(Rendering::Mode in_mode);
337 
340  Rendering::Mode GetRenderingMode() const;
341 
343  OperatorPtrArray GetOperators() const;
344 
347  void SetOperators(OperatorPtrArray & in_operators);
348 
352  void SetOperators(size_t in_count, OperatorPtr in_operators []);
353 
356  void SetOperator(OperatorPtr const & in_operator);
357 
360  void SetOperator(Operator * in_operator);
361 
363  OperatorControl GetOperatorControl();
364  OperatorControl const GetOperatorControl() const;
365 
367  NavigationCubeControl GetNavigationCubeControl();
368  NavigationCubeControl const GetNavigationCubeControl() const;
369 
371  AxisTriadControl GetAxisTriadControl();
372  AxisTriadControl const GetAxisTriadControl() const;
373 
376  SegmentKey GetSegmentKey();
377  SegmentKey const GetSegmentKey() const;
378 
381  SegmentKey GetModelOverrideSegmentKey();
382  SegmentKey const GetModelOverrideSegmentKey() const;
383 
384 
385  PortfolioKey const GetPortfolioKey() const;
386 
388  PortfolioKey GetPortfolioKey();
389 
394  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
395 
397  bool GetSimpleShadow();
398 
403  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
404 
406  bool GetSimpleReflection();
407 
409  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
410 
414  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
415 
419  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
420 
421  static UTF8 GetHideStyleName();
422  static UTF8 GetShowStyleName();
423 
425  KeyArray const GetNavigationKeys();
426 
428  LayoutArray GetOwningLayouts();
429  LayoutArray const GetOwningLayouts() const;
430 };
431 
435 class SPRK_API Model : public Sprocket
436 {
437 public:
438  Model();
439  Model(Model const & that);
440  ~Model();
441 
442  HPS::Type ObjectType() const { return HPS::Type::Model; }
443 
445  void Delete();
446 
447  Model & operator=(Model const & in_that);
448  void Assign(Model const & in_that);
449 
450  bool Equals(Model const & in_that) const;
451  bool operator!= (Model const & in_that) const;
452  bool operator== (Model const & in_that) const;
453 
455  UTF8 GetName() const;
456 
459  SegmentKey GetSegmentKey();
460  SegmentKey const GetSegmentKey() const;
461 
463  SegmentKey GetLibraryKey();
464  SegmentKey const GetLibraryKey() const;
465 
467  PortfolioKey GetPortfolioKey();
468  PortfolioKey const GetPortfolioKey() const;
469 
471  HPS::Vector GetUpVector();
472  HPS::Vector const GetUpVector() const;
473 
475  HPS::Vector GetFrontVector();
476  HPS::Vector const GetFrontVector() const;
477 
479  HPS::ViewArray GetOwningViews();
480  HPS::ViewArray const GetOwningViews() const;
481 
485  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
486 
488  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector);
489 
491  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
492 
496  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
497 };
498 
502 class SPRK_API Layout : public Sprocket
503 {
504 public:
505  Layout();
506  Layout(Layout const & that);
507  ~Layout();
508 
509  HPS::Type ObjectType() const { return HPS::Type::Layout; }
510 
512  void Delete();
513 
514  Layout & operator=(Layout const & in_that);
515  void Assign(Layout const & in_that);
516 
517  bool Equals(Layout const & in_that) const;
518  bool operator!= (Layout const & in_that) const;
519  bool operator== (Layout const & in_that) const;
520 
522  UTF8 GetName() const;
523 
525  size_t GetLayerCount() const;
526 
530  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
534  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
535 
538  void DetachLayer(size_t in_layer);
539 
542  void DetachView(View const & in_view); // everywhere it occurs
543 
546  void BringToFront(size_t in_layer);
547 
551  void ReassignLayer(size_t in_layer, HPS::View in_view);
552 
556  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
557 
559  View GetFrontView() const;
560 
564  View GetAttachedView(size_t in_layer = 0) const;
565 
569  Rectangle GetPosition(size_t in_layer) const;
570 
572  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
573 
575  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
576 
580  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
581 
585  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
586 
589  SegmentKey GetSegmentKey();
590  SegmentKey const GetSegmentKey() const;
591 
593  CanvasArray GetOwningCanvases();
594  CanvasArray const GetOwningCanvases() const;
595 
597  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
598 
602  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
603 };
604 
605 class SPRK_API CanvasDeletedEvent : public Event
606 {
607 public:
610  {
611  channel = GetClassID();
612  consumable = false;
613  }
614 
615  CanvasDeletedEvent(Canvas const & in_canvas)
616  : Event(), canvas(in_canvas)
617  {
618  channel = GetClassID();
619  consumable = false;
620  }
621 
624  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
625  {
626  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
627  {
628  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
629  canvas = that.canvas;
630  }
631  else
632  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
633  }
634 
636 
639  Event * Clone() const
640  {
641  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
642  return new_event;
643  }
644 
645  Canvas canvas;
646 };
647 
648 class SPRK_API LayoutDetachedEvent : public Event
649 {
650 public:
653  {
654  channel = GetClassID();
655  consumable = false;
656  }
657 
658  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
659  : Event(), canvas(in_canvas), layout(in_layout)
660  {
661  channel = GetClassID();
662  consumable = false;
663  }
664 
667  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
668  {
669  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
670  {
671  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
672  canvas = that.canvas;
673  layout = that.layout;
674  }
675  else
676  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
677  }
678 
680 
683  Event * Clone() const
684  {
685  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
686  return new_event;
687  }
688 
689  Canvas canvas;
690  Layout layout;
691 };
692 
693 class SPRK_API LayoutDeletedEvent : public Event
694 {
695 public:
698  {
699  channel = GetClassID();
700  consumable = false;
701  }
702 
703  LayoutDeletedEvent(Layout const & in_layout)
704  : Event(), layout(in_layout)
705  {
706  channel = GetClassID();
707  consumable = false;
708  }
709 
712  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
713  {
714  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
715  {
716  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
717  layout = that.layout;
718  }
719  else
720  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
721  }
722 
724 
727  Event * Clone() const
728  {
729  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
730  return new_event;
731  }
732 
733  Layout layout;
734 };
735 
736 class SPRK_API ViewDetachedEvent : public Event
737 {
738 public:
739  enum class Action
740  {
741  None = 0,
742  SpecificLayer,
743  AllLayers,
744  };
745 
747  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
748  {
749  channel = GetClassID();
750  consumable = false;
751  }
752 
753  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
754  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
755  {
756  channel = GetClassID();
757  consumable = false;
758  }
759 
760  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
761  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
762  {
763  channel = GetClassID();
764  consumable = false;
765  }
766 
769  ViewDetachedEvent(Event const & in_event) : Event(in_event)
770  {
771  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
772  {
773  auto that = static_cast<ViewDetachedEvent const &>(in_event);
774  layout = that.layout;
775  action = that.action;
776  layer = that.layer;
777  view = that.view;
778  }
779  else
780  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
781  }
782 
784 
787  Event * Clone() const
788  {
789  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
790  return new_event;
791  }
792 
793  Layout layout;
794  Action action;
795  size_t layer;
796  View view;
797 };
798 
799 class SPRK_API ViewDeletedEvent : public Event
800 {
801 public:
804  {
805  channel = GetClassID();
806  consumable = false;
807  }
808 
809  ViewDeletedEvent(View const & in_view)
810  : Event(), view(in_view)
811  {
812  channel = GetClassID();
813  consumable = false;
814  }
815 
818  ViewDeletedEvent(Event const & in_event) : Event(in_event)
819  {
820  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
821  {
822  auto that = static_cast<ViewDeletedEvent const &>(in_event);
823  view = that.view;
824  }
825  else
826  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
827  }
828 
829  ~ViewDeletedEvent();
830 
833  Event * Clone() const
834  {
835  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
836  return new_event;
837  }
838 
839  View view;
840 };
841 
842 class SPRK_API ModelDetachedEvent : public Event
843 {
844 public:
847  {
848  channel = GetClassID();
849  consumable = false;
850  }
851 
852  ModelDetachedEvent(View const & in_view, Model const & in_model)
853  : Event(), view(in_view), model(in_model)
854  {
855  channel = GetClassID();
856  consumable = false;
857  }
858 
861  ModelDetachedEvent(Event const & in_event) : Event(in_event)
862  {
863  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
864  {
865  auto that = static_cast<ModelDetachedEvent const &>(in_event);
866  view = that.view;
867  model = that.model;
868  }
869  else
870  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
871  }
872 
874 
877  Event * Clone() const
878  {
879  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
880  return new_event;
881  }
882 
883  View view;
884  Model model;
885 };
886 
887 class SPRK_API ModelDeletedEvent : public Event
888 {
889 public:
892  {
893  channel = GetClassID();
894  consumable = false;
895  }
896 
897  ModelDeletedEvent(Model const & in_model)
898  : Event(), model(in_model)
899  {
900  channel = GetClassID();
901  consumable = false;
902  }
903 
906  ModelDeletedEvent(Event const & in_event) : Event(in_event)
907  {
908  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
909  {
910  auto that = static_cast<ModelDeletedEvent const &>(in_event);
911  model = that.model;
912  }
913  else
914  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
915  }
916 
918 
921  Event * Clone() const
922  {
923  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
924  return new_event;
925  }
926 
927  Model model;
928 };
929 
932 class SPRK_API SprocketPath : public Sprocket
933 {
934 public:
935  SprocketPath();
936  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
937  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
938  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
939  SprocketPath(SprocketPath const & that);
940  ~SprocketPath();
941 
942  HPS::Type ObjectType() const { return HPS::Type::SprocketPath; }
943 
944  SprocketPath & operator=(SprocketPath const & in_that);
945  void Set(SprocketPath const & in_that);
946 
947  bool Equals(SprocketPath const & in_that) const;
948  bool operator!= (SprocketPath const & in_that) const;
949  bool operator== (SprocketPath const & in_that) const;
950 
952  Canvas GetCanvas() const;
953 
955  Layout GetLayout() const;
956 
958  View GetView() const;
959 
961  Model GetModel() const;
962 
967  KeyPath GetKeyPath() const;
968 };
969 
970 
973 class SPRK_API Operator : public Sprocket
974 {
975 public:
976  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
977  Operator(Operator const & in_that);
978 
979  virtual ~Operator();
980 
981  HPS::Type ObjectType() const { return HPS::Type::Operator; }
982 
983  virtual Operator & operator= (Operator const & in_that);
984 
986  virtual void Assign(Operator const & in_that);
987 
989  virtual bool Equals(Operator const & in_that) const;
990 
992  virtual bool operator!= (Operator const & in_that) const;
993 
995  virtual bool operator== (Operator const & in_that) const;
996 
998  void DetachView();
999 
1001  View GetAttachedView() const;
1002 
1004  virtual UTF8 GetName() const { return "Operator"; }
1005 
1009  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1010 
1014  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1015 
1019  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1020 
1024  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1025 
1029  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1030 
1034  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1035 
1039  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1040 
1044  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1045 
1049  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1050 
1054  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1055 
1059  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1060 
1064  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1065 
1067  virtual void OnViewAttached() { return; }
1068 
1070  virtual void OnViewDetached() { return; }
1071 
1074  virtual void OnModelAttached() { return; }
1075 
1078  virtual void OnModelDetached() { return; }
1079 
1081  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1082 
1085  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1086 
1090  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1091 
1093  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1094 
1096  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1097 
1098  enum class Priority
1099  {
1100  Low,
1101  Normal,
1102  High
1103  };
1104 
1105 protected:
1106 
1107  HPS::MouseButtons mouse_trigger;
1108  HPS::ModifierKeys modifier_trigger;
1109 };
1110 
1113 class SPRK_API OperatorControl : public SprocketControl
1114 {
1115 public:
1117  explicit OperatorControl(View const & in_view);
1118 
1120  OperatorControl(OperatorControl const & in_that);
1121 
1125  OperatorControl(OperatorControl && in_that);
1126 
1130  OperatorControl & operator=(OperatorControl && in_that);
1131 
1133  ~OperatorControl();
1134 
1135  HPS::Type ObjectType() const {return HPS::Type::OperatorControl;};
1136 
1138  OperatorControl & operator=(OperatorControl const & in_that);
1139 
1140 
1142  size_t GetCount();
1143 
1146  size_t GetCount(Operator::Priority in_priority);
1147 
1148 
1154  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1155 
1161  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1162 
1166  bool Pop(Operator::Priority in_priority = Operator::Priority::Normal);
1167 
1172  bool Pop(OperatorPtr & out_operator);
1173 
1179  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1180 
1181 
1187  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1188 
1194  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1195 
1201  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Normal);
1202 
1209  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Normal);
1210 
1211 
1215  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Normal);
1216 
1220  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1221 
1224  OperatorControl & UnsetEverything();
1225 
1226 
1230  bool ShowTop(OperatorPtr & out_operator) const;
1231 
1236  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1237 
1241  bool Show(OperatorPtrArray & out_operators) const;
1242 
1247  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1248 
1249 private:
1251  OperatorControl() {}
1252 };
1253 
1257 {
1258 public:
1259 
1260  enum class Location
1261  {
1262  TopRight,
1263  TopLeft,
1264  BottomRight,
1265  BottomLeft,
1266  Custom,
1267  };
1268 
1270  explicit NavigationCubeControl(View const & in_view);
1271 
1274 
1279 
1283  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1284 
1287 
1288  HPS::Type ObjectType() const {return HPS::Type::NavigationCubeControl;};
1289 
1291  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1292 
1299  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1300 
1303  Location GetLocation() const;
1304 
1308  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1309 
1312  HPS::Rectangle GetPosition() const;
1313 
1318  NavigationCubeControl & SetVisibility(bool in_visibility);
1319 
1322  bool GetVisibility() const;
1323 
1327  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1328 
1331  bool GetTextVisibility() const;
1332 
1347  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1348 
1351  HPS::UTF8 GetMaterialPalette() const;
1352 
1360  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1361 
1362 
1365  bool GetInteractivity() const;
1366 
1371  NavigationCubeControl & SetSize(float in_size);
1372 
1375  float GetSize() const;
1376 
1379  HPS::SegmentKey GetSegmentKey() const;
1380 
1381 private:
1384 
1386  HPS::SegmentKey GetNavigationCubeSegment() const;
1387 };
1388 
1391 class SPRK_API AxisTriadControl : public SprocketControl
1392 {
1393 public:
1394 
1395  enum class Location
1396  {
1397  TopRight,
1398  TopLeft,
1399  BottomRight,
1400  BottomLeft,
1401  Custom,
1402  };
1403 
1405  explicit AxisTriadControl(View const & in_view);
1406 
1408  AxisTriadControl(AxisTriadControl const & in_that);
1409 
1413  AxisTriadControl(AxisTriadControl && in_that);
1414 
1418  AxisTriadControl & operator=(AxisTriadControl && in_that);
1419 
1421  ~AxisTriadControl();
1422 
1423  HPS::Type ObjectType() const {return HPS::Type::AxisTriadControl;};
1424 
1426  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1427 
1434  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1435 
1438  Location GetLocation() const;
1439 
1443  AxisTriadControl & SetPosition(HPS::Rectangle const & in_rectangle);
1444 
1447  HPS::Rectangle GetPosition() const;
1448 
1453  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1454 
1457  bool GetVisibility() const;
1458 
1462  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1463 
1466  bool GetTextVisibility() const;
1467 
1476  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1477 
1480  HPS::UTF8 GetMaterialPalette() const;
1481 
1488  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1489 
1492  bool GetInteractivity() const;
1493 
1498  AxisTriadControl & SetSize(float in_size);
1499 
1502  float GetSize() const;
1503 
1506  HPS::SegmentKey GetSegmentKey() const;
1507 
1508 private:
1510  AxisTriadControl(){};
1511 
1513  HPS::SegmentKey GetAxisTriadSegment() const;
1514 };
1515 
1517 class SPRK_API Component : public Sprocket
1518 {
1519 public:
1522  enum class ComponentType : uint32_t
1523  {
1524  None = 0x00000000,
1525  GenericMask = 0xfffff000,
1526 
1527  ExchangeComponentMask = 0x00001000,
1528  ExchangeModelFile = 0x00001001,
1529  ExchangeProductOccurrence = 0x00001002,
1530  ExchangePartDefinition = 0x00001003,
1531 
1532  ExchangeView = 0x00001004,
1533  ExchangeFilter = 0x00001005,
1534 
1535  ExchangeRepresentationItemMask = 0x00003000,
1536  ExchangeRIBRepModel = 0x00003001,
1537  ExchangeRICurve = 0x00003002,
1538  ExchangeRIDirection = 0x00003003,
1539  ExchangeRIPlane = 0x00003004,
1540  ExchangeRIPointSet = 0x00003005,
1541  ExchangeRIPolyBRepModel = 0x00003006,
1542  ExchangeRIPolyWire = 0x00003007,
1543  ExchangeRISet = 0x00003008,
1544  ExchangeRICoordinateSystem = 0x00003009,
1545 
1546  ExchangeTopologyMask = 0x00005000,
1547  ExchangeTopoBody = 0x00005001,
1548  ExchangeTopoConnex = 0x00005002,
1549  ExchangeTopoShell = 0x00005003,
1550  ExchangeTopoFace = 0x00005004,
1551  ExchangeTopoLoop = 0x00005005,
1552  ExchangeTopoCoEdge = 0x00005006,
1553  ExchangeTopoEdge = 0x00005007,
1554  ExchangeTopoVertex = 0x00005008,
1555  ExchangeTopoSingleWireBody = 0x00005009,
1556  ExchangeTopoWireEdge = 0x0000500a,
1557 
1558  ExchangeDrawingMask = 0x00006000,
1559  ExchangeDrawingModel = 0x00006001,
1560  ExchangeDrawingView = 0x00006002,
1561  ExchangeDrawingSheet = 0x00006003,
1562  ExchangeBasicDrawingBlock = 0x00006004,
1563  ExchangeOperatorDrawingBlock = 0x00006005,
1564 
1565  ExchangePMIMask = 0x00009000,
1566  ExchangePMI = ExchangePMIMask,
1567  ExchangePMIText = 0x00009100,
1568  ExchangePMIRichText = 0x00009200,
1569  ExchangePMIRoughness = 0x00009300,
1570  ExchangePMIGDT = 0x00009400,
1571  ExchangePMIDatum = 0x00009500,
1572  ExchangePMILineWelding = 0x00009600,
1573  ExchangePMISpotWelding = 0x00009700,
1574  ExchangePMIDimension = 0x00009800,
1575  ExchangePMIBalloon = 0x00009900,
1576  ExchangePMICoordinate = 0x00009a00,
1577  ExchangePMIFastener = 0x00009b00,
1578  ExchangePMILocator = 0x00009c00,
1579  ExchangePMIMeasurementPoint = 0x00009d00,
1580 
1581 
1582  ParasolidComponentMask = 0x00010000,
1583 
1584  ParasolidModelFile = 0x00010001,
1585  ParasolidAssembly = 0x00010002,
1586 
1587  ParasolidTopologyMask = 0x00050000,
1588  ParasolidTopoBody = 0x00050001,
1589  ParasolidTopoRegion = 0x00050002,
1590  ParasolidTopoShell = 0x00050003,
1591  ParasolidTopoFace = 0x00050004,
1592  ParasolidTopoLoop = 0x00050005,
1593  ParasolidTopoFin = 0x00050006,
1594  ParasolidTopoEdge = 0x00050007,
1595  ParasolidTopoVertex = 0x00050008,
1596 
1597 
1598  DWGComponentMask = 0x00100000,
1599  DWGModelFile = 0x00100001,
1600  DWGLayout = 0x00100002,
1601  DWGBlockTable = 0x00100003,
1602  DWGBlockTableRecord = 0x00100004,
1603  DWGEntity = 0x00100005,
1604  DWGLayerTable = 0x00100006,
1605  DWGLayer = 0x00100007,
1606  };
1607 
1608 
1610  Component();
1611 
1614  Component(Component const & in_that);
1615 
1618  Component(Component && in_that);
1619 
1621  virtual ~Component();
1622 
1623  HPS::Type ObjectType() const { return HPS::Type::Component; }
1624 
1625 
1629  Component & operator=(Component const & in_that);
1630 
1634  Component & operator=(Component && in_that);
1635 
1639  virtual void Assign(Component const & in_that);
1640 
1644  bool Equals(Component const & in_that) const;
1645 
1649  bool operator!=(Component const & in_that) const;
1650 
1654  bool operator==(Component const & in_that) const;
1655 
1656 
1659  ComponentType GetComponentType() const;
1660 
1664  bool HasComponentType(ComponentType in_mask) const;
1665 
1666 
1667 
1673  void AddKey(Key const & in_key);
1674 
1677  KeyArray GetKeys() const;
1678 
1679 
1680 
1685  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1686 
1690  ComponentArray GetOwners() const;
1691 
1694  ComponentArray GetSubcomponents() const;
1695 
1700  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1701 
1702 
1703 
1706  void AddReference(Component & in_reference);
1707 
1710  ComponentArray GetReferrers() const;
1711 
1715  ComponentArray GetReferences() const;
1716 
1717 
1718 
1721  MetadataArray GetAllMetadata() const;
1722 
1726  Metadata GetMetadata(char const * in_name) const;
1727 
1731  UTF8 GetName() const;
1732 
1733 
1734 
1739  void Delete();
1740 
1744  void Flush();
1745 
1746 
1754  static KeyPathArray GetKeyPath(Component const & in_component);
1755 
1765  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
1766 
1775  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
1776 };
1777 
1779 class SPRK_API ComponentPath : public Sprocket
1780 {
1781 public:
1783  ComponentPath();
1784 
1787  ComponentPath(ComponentArray const & in_components);
1788 
1792  ComponentPath(size_t in_count, Component const in_components[]);
1793 
1795  ComponentPath(ComponentPath const & in_that);
1796 
1800  ComponentPath(ComponentPath && in_that);
1801 
1805  ComponentPath & operator=(ComponentPath && in_that);
1806 
1808  virtual ~ComponentPath();
1809 
1810  HPS::Type ObjectType() const { return HPS::Type::ComponentPath; }
1811 
1815  ComponentPath & operator+=(Component const & in_component);
1816 
1820  ComponentPath & operator+=(ComponentPath const & in_path);
1821 
1825  ComponentPath & operator+=(ComponentArray const & in_components);
1826 
1830  ComponentPath & Append(Component const & in_component);
1831 
1835  ComponentPath & Append(ComponentPath const & in_path);
1836 
1840  ComponentPath & Append(ComponentArray const & in_components);
1841 
1845  ComponentPath & operator=(ComponentPath const & in_that);
1846 
1850  ComponentPath & operator=(ComponentArray const & in_path);
1851 
1854  void Set(ComponentPath const & in_that);
1855 
1859  bool Equals(ComponentPath const & in_that) const;
1860 
1864  bool operator!= (ComponentPath const & in_that) const;
1865 
1869  bool operator== (ComponentPath const & in_that) const;
1870 
1871 
1875  ComponentPath & SetComponents(ComponentArray const & in_components);
1876 
1881  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
1882 
1885  ComponentArray GetComponents() const;
1886 
1890  KeyPathArray GetKeyPaths() const;
1891 
1896  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
1897 
1898 
1902  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
1903 
1908  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
1909 
1913  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
1914 
1919  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
1920 
1921 
1925  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
1926 
1930  void Show(Canvas const & in_canvas, size_t in_layer = 0);
1931 
1937  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
1938 
1942  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
1943 
1944  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0);
1945 };
1946 
1947 
1952 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
1953 {
1954  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1955 }
1956 
1961 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
1962 {
1963  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1964 }
1965 
1970 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
1971 {
1972  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1973 }
1974 
1979 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
1980 {
1981  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1982 }
1983 
1988 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
1989 {
1990  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1991 }
1992 
1997 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
1998 {
1999  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2000 }
2001 
2006 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2007 {
2008  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2009 }
2010 
2015 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2016 {
2017  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2018 }
2019 
2024 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2025 {
2026  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2027 }
2028 
2029 
2031 class SPRK_API ComponentHighlightEvent : public Event
2032 {
2033 public:
2034  enum class Action
2035  {
2036  None = 0,
2037  Highlight,
2038  Unhighlight,
2039  };
2040 
2043  {
2044  channel = GetClassID();
2045  consumable = false;
2046  action = Action::None;
2047  }
2048 
2049  ComponentHighlightEvent(Action in_action,
2050  ComponentPath const & in_path = ComponentPath(),
2051  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2052  : Event(), action(in_action), path(in_path), options(in_options)
2053  {
2054  channel = GetClassID();
2055  consumable = false;
2056  }
2057 
2060  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2061  {
2062  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2063  {
2064  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2065  action = that.action;
2066  path = that.path;
2067  options = that.options;
2068  }
2069  else
2070  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2071  }
2072 
2074 
2077  Event * Clone() const
2078  {
2079  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2080  return new_event;
2081  }
2082 
2083  Action action;
2084  ComponentPath path;
2085  HighlightOptionsKit options;
2086 };
2087 
2088 
2090 class SPRK_API Filter : public Component
2091 {
2092 public:
2094  Filter();
2095 
2099  Filter(Component const & in_that);
2100 
2103  Filter(Filter const & in_that);
2104 
2107  Filter(Filter && in_that);
2108 
2109  virtual ~Filter();
2110 
2111  HPS::Type ObjectType() const { return HPS::Type::Filter; }
2112 
2113 
2114 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2115  Filter & operator=(Filter const & in_that) = default;
2116 #endif
2117 
2121  Filter & operator=(Filter && in_that);
2122 
2123 
2126  void Activate(View const & in_view);
2127 
2130  void Deactivate(View const & in_view);
2131 };
2132 
2133 
2134 class SPRK_API FilterActivationEvent : public Event
2135 {
2136 public:
2137  enum class Action
2138  {
2139  None = 0,
2140  Activate,
2141  Deactivate,
2142  };
2143 
2146  {
2147  channel = GetClassID();
2148  consumable = false;
2149  }
2150 
2151  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2152  {
2153  channel = GetClassID();
2154  consumable = false;
2155  }
2156 
2159  FilterActivationEvent(Event const & in_event) : Event(in_event)
2160  {
2161  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2162  {
2163  auto that = static_cast<FilterActivationEvent const &>(in_event);
2164  filter = that.filter;
2165  action = that.action;
2166  view = that.view;
2167  }
2168  else
2169  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2170  }
2171 
2173 
2176  Event * Clone() const
2177  {
2178  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2179  return new_event;
2180  }
2181 
2182  Filter filter;
2183  Action action;
2184  View view;
2185 };
2186 
2187 
2189 class SPRK_API Capture : public Component
2190 {
2191 public:
2193  Capture();
2194 
2198  Capture(Component const & in_that);
2199 
2202  Capture(Capture const & in_that);
2203 
2206  Capture(Capture && in_that);
2207 
2208  virtual ~Capture();
2209 
2210  HPS::Type ObjectType() const { return HPS::Type::Capture; }
2211 
2212 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2213  Capture & operator=(Capture const & in_that) = default;
2214 #endif
2215 
2219  Capture & operator=(Capture && in_that);
2220 
2221 
2225  View Activate();
2226 };
2227 
2228 
2229 class SPRK_API CaptureActivationEvent : public Event
2230 {
2231 public:
2234  {
2235  channel = GetClassID();
2236  consumable = false;
2237  }
2238 
2239  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2240  {
2241  channel = GetClassID();
2242  consumable = false;
2243  }
2244 
2247  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2248  {
2249  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2250  {
2251  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2252  capture = that.capture;
2253  view = that.view;
2254  }
2255  else
2256  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2257  }
2258 
2260 
2263  Event * Clone() const
2264  {
2265  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2266  return new_event;
2267  }
2268 
2269  Capture capture;
2270  View view;
2271 };
2272 
2273 
2275 class SPRK_API CADModel : public Component
2276 {
2277 public:
2279  CADModel();
2280 
2284  CADModel(Component const & in_that);
2285 
2288  CADModel(CADModel const & in_that);
2289 
2292  CADModel(CADModel && in_that);
2293 
2296  CADModel(Model const & in_that);
2297 
2298  virtual ~CADModel();
2299 
2300  HPS::Type ObjectType() const { return HPS::Type::CADModel; }
2301 
2302 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2303  CADModel & operator=(CADModel const & in_that) = default;
2304 #endif
2305 
2309  CADModel & operator=(CADModel && in_that);
2310 
2311 
2315  Component GetComponentFromKey(Key const & in_key) const;
2316 
2321  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2322 
2328  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2329 
2330 
2333  Model GetModel() const;
2334 
2337  FilterArray GetAllFilters() const;
2338 
2341  CaptureArray GetAllCaptures() const;
2342 
2346  FilterArray GetActiveFilters(View const & in_view) const;
2347 
2348 
2352  View ActivateDefaultCapture();
2353 
2354 
2362  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2363 };
2364 
2365 
2366 
2369 class SPRK_API Metadata : public Sprocket
2370 {
2371 public:
2373  Metadata();
2374 
2377  Metadata(Metadata const & in_that);
2378 
2381  Metadata(Metadata && in_that);
2382 
2385  Metadata(char const * in_name);
2386 
2387  virtual ~Metadata();
2388 
2389  HPS::Type ObjectType() const { return HPS::Type::Metadata; }
2390 
2391 
2395  Metadata & operator=(Metadata const & in_that);
2396 
2400  Metadata & operator=(Metadata && in_that);
2401 
2405  virtual void Assign(Metadata const & in_that);
2406 
2410  bool Equals(Metadata const & in_that) const;
2411 
2415  bool operator!=(Metadata const & in_that) const;
2416 
2420  bool operator==(Metadata const & in_that) const;
2421 
2422 
2425  HPS::UTF8 GetName() const;
2426 
2429  void SetName(char const * in_name);
2430 };
2431 
2433 class SPRK_API IntegerMetadata : public Metadata
2434 {
2435 public:
2437  IntegerMetadata();
2438 
2442  IntegerMetadata(Metadata const & in_that);
2443 
2446  IntegerMetadata(IntegerMetadata const & in_that);
2447 
2450  IntegerMetadata(IntegerMetadata && in_that);
2451 
2455  IntegerMetadata(char const * in_name, int in_value);
2456 
2457  virtual ~IntegerMetadata();
2458 
2459  HPS::Type ObjectType() const { return HPS::Type::IntegerMetadata; }
2460 
2461 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2462  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2463 #endif
2464 
2468  IntegerMetadata & operator=(IntegerMetadata && in_that);
2469 
2470 
2473  int GetValue() const;
2474 
2477  void SetValue(int in_value);
2478 };
2479 
2481 class SPRK_API UnsignedIntegerMetadata : public Metadata
2482 {
2483 public:
2486 
2490  UnsignedIntegerMetadata(Metadata const & in_that);
2491 
2495 
2499 
2503  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2504 
2505  virtual ~UnsignedIntegerMetadata();
2506 
2507  HPS::Type ObjectType() const { return HPS::Type::UnsignedIntegerMetadata; }
2508 
2509 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2510  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2511 #endif
2512 
2516  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2517 
2518 
2521  unsigned int GetValue() const;
2522 
2525  void SetValue(unsigned int in_value);
2526 };
2527 
2529 class SPRK_API DoubleMetadata : public Metadata
2530 {
2531 public:
2533  DoubleMetadata();
2534 
2538  DoubleMetadata(Metadata const & in_that);
2539 
2542  DoubleMetadata(DoubleMetadata const & in_that);
2543 
2546  DoubleMetadata(DoubleMetadata && in_that);
2547 
2551  DoubleMetadata(char const * in_name, double in_value);
2552 
2553  virtual ~DoubleMetadata();
2554 
2555  HPS::Type ObjectType() const { return HPS::Type::DoubleMetadata; }
2556 
2557 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2558  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2559 #endif
2560 
2564  DoubleMetadata & operator=(DoubleMetadata && in_that);
2565 
2566 
2569  double GetValue() const;
2570 
2573  void SetValue(double in_value);
2574 };
2575 
2577 class SPRK_API StringMetadata : public Metadata
2578 {
2579 public:
2581  StringMetadata();
2582 
2586  StringMetadata(Metadata const & in_that);
2587 
2590  StringMetadata(StringMetadata const & in_that);
2591 
2594  StringMetadata(StringMetadata && in_that);
2595 
2599  StringMetadata(char const * in_name, char const * in_value);
2600 
2601  virtual ~StringMetadata();
2602 
2603  HPS::Type ObjectType() const { return HPS::Type::StringMetadata; }
2604 
2605 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2606  StringMetadata & operator=(StringMetadata const & in_that) = default;
2607 #endif
2608 
2612  StringMetadata & operator=(StringMetadata && in_that);
2613 
2614 
2617  UTF8 GetValue() const;
2618 
2621  void SetValue(char const * in_value);
2622 };
2623 
2625 class SPRK_API TimeMetadata : public Metadata
2626 {
2627 public:
2629  TimeMetadata();
2630 
2634  TimeMetadata(Metadata const & in_that);
2635 
2638  TimeMetadata(TimeMetadata const & in_that);
2639 
2642  TimeMetadata(TimeMetadata && in_that);
2643 
2647  TimeMetadata(char const * in_name, unsigned int in_value);
2648 
2649  virtual ~TimeMetadata();
2650 
2651  HPS::Type ObjectType() const { return HPS::Type::TimeMetadata; }
2652 
2653 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2654  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
2655 #endif
2656 
2660  TimeMetadata & operator=(TimeMetadata && in_that);
2661 
2662 
2665  unsigned int GetValue() const;
2666 
2669  HPS::UTF8 GetValueAsString() const;
2670 
2673  void SetValue(unsigned int in_value);
2674 };
2675 
2676 
2678 class SPRK_API BooleanMetadata : public Metadata
2679 {
2680 public:
2682  BooleanMetadata();
2683 
2687  BooleanMetadata(Metadata const & in_that);
2688 
2691  BooleanMetadata(BooleanMetadata const & in_that);
2692 
2695  BooleanMetadata(BooleanMetadata && in_that);
2696 
2700  BooleanMetadata(char const * in_name, bool in_value);
2701 
2702  virtual ~BooleanMetadata();
2703 
2704  HPS::Type ObjectType() const { return HPS::Type::BooleanMetadata; }
2705 
2706 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2707  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
2708 #endif
2709 
2713  BooleanMetadata & operator=(BooleanMetadata && in_that);
2714 
2715 
2718  bool GetValue() const;
2719 
2722  void SetValue(bool in_value);
2723 };
2724 
2725 
2726 
2728 class SPRK_API Factory : public Sprocket
2729 {
2730 public:
2731 
2734  static CanvasArray GetCanvases();
2735 
2738  static LayoutArray GetLayouts();
2739 
2742  static ViewArray GetViews();
2743 
2746  static ModelArray GetModels();
2747 
2750  static CADModelArray GetCADModels();
2751 
2757  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
2758 
2763  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
2764 
2770  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
2771 
2775  static Layout CreateLayout(char const * in_name = "");
2776 
2780  static View CreateView(char const * in_name = "");
2781 
2785  static Model CreateModel(char const * in_name = "");
2786 
2787 private:
2788  Factory() {}
2789 };
2790 
2800 class SPRK_API AxisTriadOperator : public Operator
2801 {
2802 public:
2803  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2805  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
2806 
2812  virtual bool OnMouseDown(MouseState const & in_state);
2817  virtual bool OnMouseUp(MouseState const & in_state);
2822  virtual bool OnMouseMove(MouseState const & in_state);
2823 
2828  virtual bool OnTouchDown(TouchState const & in_state);
2833  virtual bool OnTouchUp(TouchState const & in_state);
2838  virtual bool OnTouchMove(TouchState const & in_state);
2839 
2840  virtual void OnViewAttached();
2841  virtual void OnViewDetached();
2842 
2843 private:
2844 
2845  bool AxisOrbit(HPS::WindowPoint const & in_loc);
2846  void Transition(HPS::SelectionResults selection_results);
2847  void TranslatePoint(HPS::WindowPoint * point);
2848  bool IsEventRelevant(HPS::Point const & event_location);
2849 
2850  bool operator_active;
2851  HPS::WindowPoint start_point;
2852  HPS::Vector start_sphere_point;
2853  float axis_subwindow_width;
2854  float axis_subwindow_height;
2855  HPS::TouchID tracked_touch_ID;
2856  HPS::Rectangle axis_subwindow;
2857  HPS::SegmentKey axis_triad_segment;
2858 
2859 };
2860 
2863 {
2864 public:
2867  virtual ~SmoothTransitionCompleteEvent();
2868 
2871  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
2872  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
2873 
2876  Event * Clone() const
2877  {
2879  return new_event;
2880  }
2881 
2885  virtual bool Drop(Event const * in_that_event) const
2886  {
2887  HPS_UNREFERENCED(in_that_event);
2888  return false;
2889  }
2890 
2891  HPS::View view;
2892 };
2893 
2903 class SPRK_API NavigationCubeOperator : public Operator
2904 {
2905 public:
2906  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2907  ~NavigationCubeOperator() { OnViewDetached(); }
2908 
2910  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
2911 
2916  virtual bool OnMouseDown(MouseState const & in_state);
2921  virtual bool OnMouseUp(MouseState const & in_state);
2926  virtual bool OnMouseMove(MouseState const & in_state);
2927 
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  virtual void OnModelAttached();
2947 
2948  void UpdateHighlightColor();
2949 
2953  void SetReferenceSegment(HPS::SegmentKey const & in_segment);
2954 
2959  void SetReferenceSegment(HPS::SegmentKeyArray const & in_segments);
2960 
2964  HPS::SegmentKeyArray ShowReferenceSegment();
2965 
2966 private:
2967  void Transition(HPS::SelectionResults selection_results);
2968  bool Orbit(HPS::WindowPoint const & in_loc);
2969  void TranslatePoint(HPS::WindowPoint * point);
2970  bool IsEventRelevant(HPS::Point const & event_location);
2971  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
2972 
2973  bool operator_active;
2974  HPS::TouchID tracked_touch_ID;
2975  HPS::WindowPoint start_point;
2976  HPS::WindowPoint down_position;
2977  HPS::Vector start_sphere_point;
2978  HPS::SegmentKeyArray reference_segments; //rotation and zooming happen around these segments
2979 
2980  HPS::SegmentKey nav_cube_segment;
2981  HPS::SegmentKey style_segment;
2982  HPS::PortfolioKey portfolio;
2983  HPS::ReferenceKeyArrayArray groups;
2984  HPS::HighlightOptionsKit highlight_options_kit;
2985  HPS::CameraKit previous_camera;
2986  int previous_face;
2987  bool suppress_mouse_over_highlights;
2988 
2989  HPS::Rectangle nav_cube_subwindow;
2990  float nav_cube_subwindow_width;
2991  float nav_cube_subwindow_height;
2992 
2993  int highlighted_group;
2994 
2995  bool moving;
2996 
2997  class SmoothTransitionCompleteEventHandler : public EventHandler
2998  {
2999  public:
3000  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3001  : handler_view(in_view), handler_moving(&in_moving) {}
3002 
3003  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3004 
3005  virtual HandleResult Handle(HPS::Event const * in_event);
3006 
3007  private:
3008  View handler_view;
3009  bool * handler_moving;
3010  };
3011 
3012  SmoothTransitionCompleteEventHandler * handler;
3013 };
3014 
3015 
3016 
3017 
3018 class SceneTreeItem;
3019 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3020 class SceneTree;
3021 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3022 
3025 class SPRK_API SceneTree : public Sprocket
3026 {
3027 public:
3030  enum class ItemType : uint32_t
3031  {
3032  None = 0x00000000,
3033  GenericMask = 0xffff0000,
3034 
3035  Segment = 0x00000001,
3036  Include = 0x00000002,
3037  ConditionalExpression = 0x00000003,
3038  StaticModelSegment = 0x00000004,
3039  AttributeFilter = 0x00000005,
3040 
3041  Geometry = 0x00010000,
3042  CuttingSection = 0x00010001,
3043  Shell = 0x00010002,
3044  Mesh = 0x00010003,
3045  Grid = 0x00010004,
3046  NURBSSurface = 0x00010005,
3047  Cylinder = 0x00010006,
3048  Sphere = 0x00010007,
3049  Polygon = 0x00010008,
3050  Circle = 0x00010009,
3051  CircularWedge = 0x0001000a,
3052  Ellipse = 0x0001000b,
3053  Line = 0x0001000c,
3054  NURBSCurve = 0x0001000d,
3055  CircularArc = 0x0001000e,
3056  EllipticalArc = 0x0001000f,
3057  InfiniteLine = 0x00010010,
3058  InfiniteRay = 0x00010011,
3059  Marker = 0x00010012,
3060  Text = 0x00010013,
3061  Reference = 0x00010014,
3062  DistantLight = 0x00010015,
3063  Spotlight = 0x00010016,
3064 
3065  Attribute = 0x00020000,
3066  Portfolio = 0x00020001,
3067  SegmentStyle = 0x00020002,
3068  NamedStyle = 0x00020003,
3069  MaterialPalette = 0x00020004,
3070  Priority = 0x00020005,
3071  Material = 0x00020006,
3072  Camera = 0x00020007,
3073  ModellingMatrix = 0x00020008,
3074  UserData = 0x00020009,
3075  TextureMatrix = 0x0002000a,
3076  Culling = 0x0002000b,
3077  CurveAttribute = 0x0002000c,
3078  CylinderAttribute = 0x0002000d,
3079  EdgeAttribute = 0x0002000e,
3080  LightingAttribute = 0x0002000f,
3081  LineAttribute = 0x00020010,
3082  MarkerAttribute = 0x00020011,
3083  SurfaceAttribute = 0x00020012,
3084  Selectability = 0x00020013,
3085  SphereAttribute = 0x00020014,
3086  Subwindow = 0x00020015,
3087  TextAttribute = 0x00020016,
3088  Transparency = 0x00020017,
3089  Visibility = 0x00020018,
3090  VisualEffects = 0x00020019,
3091  Performance = 0x00020020,
3092  DrawingAttribute = 0x00020021,
3093  HiddenLineAttribute = 0x00020022,
3094  ContourLine = 0x00020023,
3095  Condition = 0x00020024,
3096  Bounding = 0x00020025,
3097  AttributeLock = 0x00020026,
3098  TransformMask = 0x00020027,
3099  ColorInterpolation = 0x00020028,
3100  CuttingSectionAttribute = 0x00020029,
3101 
3102  // window only attributes
3103  Debugging = 0x00020030,
3104  PostProcessEffects = 0x00020031,
3105  SelectionOptions = 0x00020032,
3106  UpdateOptions = 0x00020033,
3107 
3108  Definition = 0x00040000,
3109  NamedStyleDefinition = 0x00040001,
3110  TextureDefinition = 0x00040002,
3111  LinePatternDefinition = 0x00040003,
3112  GlyphDefinition = 0x00040004,
3113  CubeMapDefinition = 0x00040005,
3114  ImageDefinition = 0x00040006,
3115  MaterialPaletteDefinition = 0x00040007,
3116  ShaderDefinition = 0x00040008,
3117 
3118  Group = 0x00080000,
3119  SegmentGroup = 0x00080100,
3120  GeometryGroup = 0x00080200,
3121  AttributeGroup = 0x00080300,
3122  PortfolioGroup = 0x00080400,
3123  StyleGroup = 0x00080500,
3124  IncludeGroup = 0x00080600,
3125  DefinitionGroup = 0x00180000,
3126  NamedStyleDefinitionGroup = 0x00180700,
3127  TextureDefinitionGroup = 0x00180800,
3128  LinePatternDefinitionGroup = 0x00180900,
3129  GlyphDefinitionGroup = 0x00180a00,
3130  CubeMapDefinitionGroup = 0x00180b00,
3131  ImageDefinitionGroup = 0x00180c00,
3132  MaterialPaletteDefinitionGroup = 0x00180d00,
3133  ShaderDefinitionGroup = 0x00180e00,
3134  CuttingSectionGroup = 0x00080001,
3135  ShellGroup = 0x00080002,
3136  MeshGroup = 0x00080003,
3137  GridGroup = 0x00080004,
3138  NURBSSurfaceGroup = 0x00080005,
3139  CylinderGroup = 0x00080006,
3140  SphereGroup = 0x00080007,
3141  PolygonGroup = 0x00080008,
3142  CircleGroup = 0x00080009,
3143  CircularWedgeGroup = 0x0008000a,
3144  EllipseGroup = 0x0008000b,
3145  LineGroup = 0x0008000c,
3146  NURBSCurveGroup = 0x0008000d,
3147  CircularArcGroup = 0x0008000e,
3148  EllipticalArcGroup = 0x0008000f,
3149  InfiniteLineGroup = 0x00080010,
3150  InfiniteRayGroup = 0x00080011,
3151  MarkerGroup = 0x00080012,
3152  TextGroup = 0x00080013,
3153  ReferenceGroup = 0x00080014,
3154  DistantLightGroup = 0x00080015,
3155  SpotlightGroup = 0x00080016,
3156  };
3157 
3159  SceneTree();
3160 
3163  SceneTree(Canvas const & in_canvas);
3164 
3167  SceneTree(SceneTree const & in_that);
3168 
3171  SceneTree(SceneTree && in_that);
3172 
3173  virtual ~SceneTree();
3174 
3175  virtual HPS::Type ObjectType() const { return HPS::Type::SceneTree; }
3176 
3180  SceneTree & operator=(SceneTree const & in_that);
3181 
3185  SceneTree & operator=(SceneTree && in_that);
3186 
3190  virtual void Assign(SceneTree const & in_that);
3191 
3195  bool Equals(SceneTree const & in_that) const;
3196 
3200  bool operator!=(SceneTree const & in_that) const;
3201 
3205  bool operator==(SceneTree const & in_that) const;
3206 
3207 
3215  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3216 
3219  HighlightOptionsKit GetHighlightOptions() const;
3220 
3221 
3226  void SetGroupingLimit(size_t in_limit);
3227 
3230  size_t GetGroupingLimit() const;
3231 
3232 
3239  void SetRoot(SceneTreeItemPtr const & in_root);
3240 
3243  SceneTreeItemPtr GetRoot() const;
3244 
3245 
3248  virtual void Flush();
3249 };
3250 
3251 
3254 class SPRK_API SceneTreeItem : public Sprocket
3255 {
3256 public:
3258  SceneTreeItem();
3259 
3262  SceneTreeItem(SceneTreeItem const & in_that);
3263 
3266  SceneTreeItem(SceneTreeItem && in_that);
3267 
3273  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3274 
3280  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3281 
3287  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3288 
3294  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3295 
3303  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3304 
3305  virtual ~SceneTreeItem();
3306 
3307  HPS::Type ObjectType() const { return HPS::Type::SceneTreeItem; }
3308 
3312  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3313 
3317  SceneTreeItem & operator=(SceneTreeItem && in_that);
3318 
3322  virtual void Assign(SceneTreeItem const & in_that);
3323 
3327  bool Equals(SceneTreeItem const & in_that) const;
3328 
3332  bool operator!=(SceneTreeItem const & in_that) const;
3333 
3337  bool operator==(SceneTreeItem const & in_that) const;
3338 
3339 
3342  SceneTreePtr GetTree() const;
3343 
3346  UTF8 GetTitle() const;
3347 
3350  SceneTree::ItemType GetItemType() const;
3351 
3355  bool HasItemType(SceneTree::ItemType in_mask) const;
3356 
3359  Key GetKey() const;
3360 
3363  bool HasChildren() const;
3364 
3365 
3374  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3375 
3376 
3379  virtual void Expand();
3380 
3383  virtual void Collapse();
3384 
3385 
3390  bool IsSelected() const;
3391 
3397  virtual void Select();
3398 
3404  virtual void Unselect();
3405 
3410  bool IsHighlightable() const;
3411 
3417  bool IsHighlighted() const;
3418 
3422  void Highlight();
3423 
3428  void Unhighlight();
3429 };
3430 
3431 
3432 
3433 class ComponentTreeItem;
3434 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3435 class ComponentTree;
3436 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3437 
3440 class SPRK_API ComponentTree : public Sprocket
3441 {
3442 public:
3445  enum class ItemType
3446  {
3447  None,
3448  ExchangeComponent,
3449  ExchangeModelFile,
3450 
3451  ExchangeViewGroup,
3452  ExchangeAnnotationViewGroup,
3453  ExchangePMIGroup,
3454  ExchangeModelGroup,
3455 
3456  ParasolidComponent,
3457  ParasolidModelFile,
3458 
3459  DWGComponent,
3460  DWGModelFile,
3461  };
3462 
3464  ComponentTree();
3465 
3469  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3470 
3473  ComponentTree(ComponentTree const & in_that);
3474 
3477  ComponentTree(ComponentTree && in_that);
3478 
3479  virtual ~ComponentTree();
3480 
3481  virtual HPS::Type ObjectType() const { return HPS::Type::ComponentTree; }
3482 
3486  ComponentTree & operator=(ComponentTree const & in_that);
3487 
3491  ComponentTree & operator=(ComponentTree && in_that);
3492 
3496  virtual void Assign(ComponentTree const & in_that);
3497 
3501  bool Equals(ComponentTree const & in_that) const;
3502 
3506  bool operator!=(ComponentTree const & in_that) const;
3507 
3511  bool operator==(ComponentTree const & in_that) const;
3512 
3513 
3521  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3522 
3525  HighlightOptionsKit GetHighlightOptions() const;
3526 
3527 
3534  void SetRoot(ComponentTreeItemPtr const & in_root);
3535 
3538  ComponentTreeItemPtr GetRoot() const;
3539 
3540 
3543  virtual void Flush();
3544 };
3545 
3546 
3549 class SPRK_API ComponentTreeItem : public Sprocket
3550 {
3551 public:
3554 
3557  ComponentTreeItem(ComponentTreeItem const & in_that);
3558 
3562 
3568  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
3569 
3576  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
3577 
3578  virtual ~ComponentTreeItem();
3579 
3580  HPS::Type ObjectType() const { return HPS::Type::ComponentTreeItem; }
3581 
3585  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
3586 
3590  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
3591 
3595  virtual void Assign(ComponentTreeItem const & in_that);
3596 
3600  bool Equals(ComponentTreeItem const & in_that) const;
3601 
3605  bool operator!=(ComponentTreeItem const & in_that) const;
3606 
3610  bool operator==(ComponentTreeItem const & in_that) const;
3611 
3612 
3613 
3616  ComponentTreePtr GetTree() const;
3617 
3620  UTF8 GetTitle() const;
3621 
3624  ComponentTree::ItemType GetItemType() const;
3625 
3628  Component GetComponent() const;
3629 
3632  bool HasChildren() const;
3633 
3636  ComponentPath GetPath() const;
3637 
3638 
3646  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
3647 
3648 
3651  virtual void Expand();
3652 
3655  virtual void Collapse();
3656 
3657 
3663  bool IsHighlighted() const;
3664 
3669  virtual void OnHighlight(HighlightOptionsKit const & in_options);
3670 
3675  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
3676 
3677 
3681  void Highlight();
3682 
3686  void Unhighlight();
3687 
3688 
3698  bool IsHidden() const;
3699 
3703  virtual void OnHide();
3704 
3708  virtual void OnShow();
3709 
3713  void Hide();
3714 
3718  void Show();
3719 
3724  void Isolate();
3725 
3728  bool IsExpanded() const;
3729 };
3730 
3731 
3732 
3733 
3734 }
3735 #endif
3736 
3737 
3738 
Definition: sprk.h:2625
HPS::Type ObjectType() const
Definition: sprk.h:2459
Definition: hps.h:6049
HPS::Type ObjectType() const
Definition: sprk.h:442
Event * Clone() const
Definition: sprk.h:683
Definition: sprk.h:2800
Definition: sprk.h:243
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2060
HPS::Type ObjectType() const
Definition: sprk.h:251
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1064
Definition: hps.h:38137
Definition: hps.h:1506
ComponentHighlightEvent()
Definition: sprk.h:2042
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1090
Definition: hps.h:467
HPS::Type ObjectType() const
Definition: sprk.h:216
HPS::Type ObjectType() const
Definition: sprk.h:981
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1054
HPS::Type ObjectType() const
Definition: sprk.h:2111
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5558
Location
Definition: sprk.h:1260
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1093
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1059
ItemType
Definition: sprk.h:3445
Definition: hps.h:5598
CaptureActivationEvent()
Definition: sprk.h:2233
Definition: sprk.h:66
Definition: sprk.h:213
Definition: sprk.h:605
Definition: sprk.h:106
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1019
Definition: sprk.h:3549
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1029
Definition: sprk.h:2678
HPS::Type ObjectType() const
Definition: sprk.h:2300
Definition: hps.h:37924
Definition: hps.h:1325
Definition: hps.h:1048
HPS::Type ObjectType() const
Definition: sprk.h:1810
Definition: hps.h:1678
ModelDeletedEvent()
Definition: sprk.h:891
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:2871
Definition: sprk.h:3440
Definition: hps.h:42259
Definition: sprk.h:932
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1044
Definition: hps.h:7427
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1085
virtual HPS::Type ObjectType() const
Definition: sprk.h:3175
Definition: hps.h:3419
Definition: hps.h:2006
Definition: sprk.h:842
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:727
Definition: sprk.h:693
Definition: hps.h:1396
Definition: hps.h:879
HPS::Type ObjectType() const
Definition: sprk.h:1423
UpdateControl
Definition: hps.h:175
Definition: hps.h:38042
virtual void OnModelDetached()
Definition: sprk.h:1078
Definition: hps.h:1724
Definition: hps.h:1535
Definition: hps.h:8628
Definition: hps.h:236
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1081
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1776
Event * Clone() const
Definition: sprk.h:833
Definition: hps.h:42158
Definition: hps.h:37033
Definition: sprk.h:1256
Definition: sprk.h:887
Definition: sprk.h:502
HPS::Type ObjectType() const
Definition: sprk.h:113
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:769
virtual void OnViewDetached()
Definition: sprk.h:1070
Definition: hps.h:37079
HPS::Type ObjectType() const
Definition: sprk.h:3307
LayoutDeletedEvent()
Definition: sprk.h:697
Event * Clone() const
Definition: sprk.h:877
virtual void OnViewAttached()
Definition: sprk.h:1067
Definition: hps.h:36548
Definition: hps.h:39283
Definition: hps.h:1087
Definition: sprk.h:2369
LayoutDetachedEvent()
Definition: sprk.h:652
Definition: sprk.h:2481
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1034
Definition: hps.h:9358
Definition: hps.h:38085
Definition: hps.h:1483
SmoothTransitionCompleteEvent()
Definition: sprk.h:2866
Definition: hps.h:1422
HPS::Type ObjectType() const
Definition: sprk.h:509
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1014
FilterActivationEvent()
Definition: sprk.h:2145
Definition: hps.h:1441
virtual void OnModelAttached()
Definition: sprk.h:1074
Definition: hps.h:34985
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2159
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:861
HPS::Type ObjectType() const
Definition: sprk.h:1288
HPS::Type ObjectType() const
Definition: sprk.h:1623
Definition: hps.h:6797
Location
Definition: sprk.h:1395
Definition: hps.h:41650
UpdateType
Definition: sprk.h:78
Definition: sprk.h:2433
Definition: sprk.h:1391
Definition: hps.h:39455
HPS::Type ObjectType() const
Definition: sprk.h:1135
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:233
Definition: hps.h:40827
virtual UTF8 GetName() const
Definition: sprk.h:1004
Definition: hps.h:42046
Definition: sprk.h:648
Event * Clone() const
Definition: sprk.h:2176
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2247
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1039
HPS::Type ObjectType() const
Definition: sprk.h:2555
CanvasDeletedEvent()
Definition: sprk.h:609
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1024
HPS::Type ObjectType() const
Definition: sprk.h:2389
HPS::Type ObjectType() const
Definition: sprk.h:2507
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:228
Event * Clone() const
Definition: sprk.h:2263
Definition: hps.h:14453
ViewDeletedEvent()
Definition: sprk.h:803
intptr_t GetChannel() const
Definition: hps.h:6182
Definition: sprk.h:736
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:2885
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2805
Definition: sprk.h:1517
Definition: hps.h:39732
Definition: hps.h:41315
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:818
Definition: hps.h:34582
Definition: sprk.h:2577
ViewDetachedEvent()
Definition: sprk.h:747
Definition: hps.h:6149
Definition: sprk.h:1113
Definition: hps.h:403
HPS::Type ObjectType() const
Definition: sprk.h:2603
Event * Clone() const
Definition: sprk.h:2077
Definition: sprk.h:435
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:624
Definition: sprk.h:2903
Definition: sprk.h:1779
ComponentType
Definition: sprk.h:1522
Definition: hps.h:40753
Definition: hps.h:7052
Definition: sprk.h:2031
Event * Clone() const
Definition: sprk.h:639
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:667
HPS::Type ObjectType() const
Definition: sprk.h:3580
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1009
ItemType
Definition: sprk.h:3030
Definition: sprk.h:2090
Definition: sprk.h:2728
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2910
Definition: sprk.h:190
Definition: sprk.h:2862
Definition: hps.h:423
Event * Clone() const
Definition: sprk.h:921
Definition: sprk.h:2189
Definition: hps.h:2024
ModelDetachedEvent()
Definition: sprk.h:846
static MouseButtons ButtonLeft()
Definition: hps.h:41768
virtual HPS::Type ObjectType() const
Definition: sprk.h:3481
Definition: sprk.h:3025
Definition: sprk.h:2529
Definition: hps.h:8744
HPS::Type ObjectType() const
Definition: sprk.h:942
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1096
Definition: hps.h:7346
Definition: sprk.h:2134
Definition: hps.h:34198
Definition: hps.h:346
Event * Clone() const
Definition: sprk.h:2876
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:906
Event * Clone() const
Definition: sprk.h:787
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:712
Definition: hps.h:8958
Definition: hps.h:10395
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1049
Definition: sprk.h:3254
Definition: sprk.h:2275
Mode
Definition: sprk.h:195
Definition: hps.h:513
Definition: sprk.h:973
Definition: hps.h:1129
Definition: hps.h:37969
Definition: sprk.h:799
Definition: sprk.h:2229
Definition: hps.h:36611
HPS::Type ObjectType() const
Definition: sprk.h:2651
HPS::Type ObjectType() const
Definition: sprk.h:2210
HPS::Type ObjectType() const
Definition: sprk.h:2704