Overview

Sample Code

Programming Guide

API Reference

Support

sprk.h
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef SPRK_H
11 #define SPRK_H
12 
13 #include "hps.h"
14 
15 #include <memory>
16 
17 #ifdef _MSC_VER
18 # pragma warning(disable: 4251) //Not an issue as long as debug and release libraries aren't mixed
19 #ifndef STATIC_APP
20 # ifdef SPRK
21 # define SPRK_API __declspec (dllexport)
22 # else
23 # define SPRK_API __declspec (dllimport)
24 # endif
25 #endif
26 #else
27 # include <stddef.h>
28 # if defined(LINUX_SYSTEM) && defined(SPRK)
29 # ifndef STATIC_APP
30 # define SPRK_API __attribute__ ((visibility ("default")))
31 # endif
32 # endif
33 #endif
34 
35 #ifndef SPRK_API
36 # define SPRK_API
37 #endif
38 namespace SPRKI
39 {
40  class X;
41 };
42 
43 namespace HPS
44 {
45 
46 class Factory;
47 class Canvas;
48 class Layout;
49 class View;
50 class Model;
51 class Operator;
52 class OperatorControl;
53 class NavigationCubeControl;
54 class AxisTriadControl;
55 class Component;
56 class ComponentPath;
57 class ComponentHighlightEvent;
58 class Filter;
59 class Capture;
60 class CADModel;
61 class Metadata;
62 
63 
64 
65 
66 class SPRK_API Sprocket : public HPS::Object
67 {
68 public:
69  Sprocket() {}
70 #if !defined(_MSC_VER) || _MSC_VER >= 1900
71  Sprocket(HPS::Sprocket const & in_that) = default;
72 #endif
73  Sprocket(Sprocket && in_that) : HPS::Object(std::move(in_that)) {}
74 
75  virtual ~Sprocket() {}
76 };
77 
78 typedef std::shared_ptr<Operator> OperatorPtr;
79 
80 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
81 
82 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
83 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
84 typedef std::vector<View, Allocator<View> > ViewArray;
85 typedef std::vector<Model, Allocator<Model> > ModelArray;
86 
87 typedef std::vector<Component, Allocator<Component> > ComponentArray;
88 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
89 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
90 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
91 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
92 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
93 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
94 typedef std::vector<HighlightOptionsKit, Allocator<HighlightOptionsKit>> HighlightOptionsKitArray;
95 
96 
100 class SPRK_API Canvas : public Sprocket
101 {
102 public:
103  Canvas();
104  Canvas(Canvas const & that);
105  ~Canvas();
106 
107  HPS::Type ObjectType() const { return HPS::Type::Canvas; }
108 
110  void Delete();
111 
112  Canvas & operator=(Canvas const & in_that);
113  void Assign(Canvas const & in_that);
114 
115  bool Equals(Canvas const & in_that) const;
116  bool operator!= (Canvas const & in_that) const;
117  bool operator== (Canvas const & in_that) const;
118 
120  UTF8 GetName() const;
121 
125  void AttachLayout(Layout const & in_layout);
126 
130  void AttachViewAsLayout(View const & in_view);
131 
133  void DetachLayout();
134 
136  Layout GetAttachedLayout() const;
137 
139  IncludeKey GetAttachedLayoutIncludeLink() const;
140 
142  View GetFrontView() const;
143 
144  WindowKey const GetWindowKey() const;
145 
148  WindowKey GetWindowKey();
149 
150  PortfolioKey const GetPortfolioKey() const;
151 
153  PortfolioKey GetPortfolioKey();
154 
156  void Update() const;
157 
160  UpdateNotifier UpdateWithNotifier() const;
161 
165  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
166 
171  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
172 
176  void SetFrameRate(float in_frame_rate=20);
177 
181  float GetFrameRate() const;
182 };
183 
184 class SPRK_API Rendering
185 {
186 public:
189  enum class Mode
190  {
191  Gouraud,
192  GouraudWithLines,
193  Flat,
194  FlatWithLines,
195  Phong,
196  PhongWithLines,
197  HiddenLine,
198  FastHiddenLine,
199  Wireframe,
200  Default = Phong
201  };
202 
203 private:
204  Rendering() {}
205 };
206 
207 class SPRK_API SprocketControl : public Sprocket
208 {
209 public:
210  HPS::Type ObjectType() const {return HPS::Type::SprocketControl;}
211 
212 #if !defined(_MSC_VER) || _MSC_VER >= 1900
213  SprocketControl(HPS::SprocketControl const & in_that) = default;
214 #endif
215 
216 protected:
217  SprocketControl() {}
218 
222  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
223 
228  {
229  this->Object::operator=(std::move(in_that));
230  return *this;
231  }
232 };
233 
237 class SPRK_API View : public Sprocket
238 {
239 public:
240  View();
241  View(View const & that);
242  explicit View(SprocketControl const & in_ctrl);
243  ~View();
244 
245  HPS::Type ObjectType() const { return HPS::Type::View; }
246 
248  void Delete();
249 
250  View & operator=(View const & in_that);
251  void Assign(View const & in_that);
252 
253  bool Equals(View const & in_that) const;
254  bool operator!= (View const & in_that) const;
255  bool operator== (View const & in_that) const;
256 
258  UTF8 GetName() const;
259 
260 
263  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
264 
268  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
269 
270 
274  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
275 
281  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
282 
283 
289  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
290 
291 
293  HPS::View & FitWorld();
294 
297  HPS::View & FitWorld(SegmentKey const & in_segment);
298 
299 
302  HPS::View & FitWorld(BoundingKit const & in_bounding);
303 
308  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
309 
310 
315  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
316 
321  void AttachModel(Model const & in_model);
322 
324  void DetachModel();
325 
327  Model GetAttachedModel() const;
328 
330  IncludeKey GetAttachedModelIncludeLink() const;
331 
335  void SetRenderingMode(Rendering::Mode in_mode);
336 
339  Rendering::Mode GetRenderingMode() const;
340 
342  OperatorPtrArray GetOperators() const;
343 
346  void SetOperators(OperatorPtrArray & in_operators);
347 
351  void SetOperators(size_t in_count, OperatorPtr in_operators []);
352 
355  void SetOperator(OperatorPtr const & in_operator);
356 
359  void SetOperator(Operator * in_operator);
360 
362  OperatorControl GetOperatorControl();
363  OperatorControl const GetOperatorControl() const;
364 
366  NavigationCubeControl GetNavigationCubeControl();
367  NavigationCubeControl const GetNavigationCubeControl() const;
368 
370  AxisTriadControl GetAxisTriadControl();
371  AxisTriadControl const GetAxisTriadControl() const;
372 
375  SegmentKey GetSegmentKey();
376  SegmentKey const GetSegmentKey() const;
377 
380  SegmentKey GetModelOverrideSegmentKey();
381  SegmentKey const GetModelOverrideSegmentKey() const;
382 
383 
384  PortfolioKey const GetPortfolioKey() const;
385 
387  PortfolioKey GetPortfolioKey();
388 
393  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
394 
396  bool GetSimpleShadow();
397 
402  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
403 
405  bool GetSimpleReflection();
406 
408  void Update() const;
409 
412  UpdateNotifier UpdateWithNotifier() const;
413 
417  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
418 
424  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
425 
429  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
430 
431  static UTF8 GetHideStyleName();
432  static UTF8 GetShowStyleName();
433 
435  KeyArray const GetNavigationKeys();
436 
438  LayoutArray GetOwningLayouts();
439  LayoutArray const GetOwningLayouts() const;
440 };
441 
445 class SPRK_API Model : public Sprocket
446 {
447 public:
448  Model();
449  Model(Model const & that);
450  ~Model();
451 
452  HPS::Type ObjectType() const { return HPS::Type::Model; }
453 
455  void Delete();
456 
457  Model & operator=(Model const & in_that);
458  void Assign(Model const & in_that);
459 
460  bool Equals(Model const & in_that) const;
461  bool operator!= (Model const & in_that) const;
462  bool operator== (Model const & in_that) const;
463 
465  UTF8 GetName() const;
466 
469  SegmentKey GetSegmentKey();
470  SegmentKey const GetSegmentKey() const;
471 
473  SegmentKey GetLibraryKey();
474  SegmentKey const GetLibraryKey() const;
475 
477  PortfolioKey GetPortfolioKey();
478  PortfolioKey const GetPortfolioKey() const;
479 
481  HPS::Vector GetUpVector();
482  HPS::Vector const GetUpVector() const;
483 
485  HPS::Vector GetFrontVector();
486  HPS::Vector const GetFrontVector() const;
487 
489  HPS::ViewArray GetOwningViews();
490  HPS::ViewArray const GetOwningViews() const;
491 
495  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
496 
498  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector);
499 
501  void Update() const;
502 
505  UpdateNotifier UpdateWithNotifier() const;
506 
510  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
511 
517  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
518 
519 };
520 
524 class SPRK_API Layout : public Sprocket
525 {
526 public:
527  Layout();
528  Layout(Layout const & that);
529  ~Layout();
530 
531  HPS::Type ObjectType() const { return HPS::Type::Layout; }
532 
534  void Delete();
535 
536  Layout & operator=(Layout const & in_that);
537  void Assign(Layout const & in_that);
538 
539  bool Equals(Layout const & in_that) const;
540  bool operator!= (Layout const & in_that) const;
541  bool operator== (Layout const & in_that) const;
542 
544  UTF8 GetName() const;
545 
547  size_t GetLayerCount() const;
548 
552  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
556  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
557 
560  void DetachLayer(size_t in_layer);
561 
564  void DetachView(View const & in_view); // everywhere it occurs
565 
568  void BringToFront(size_t in_layer);
569 
573  void ReassignLayer(size_t in_layer, HPS::View in_view);
574 
578  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
579 
581  View GetFrontView() const;
582 
586  View GetAttachedView(size_t in_layer = 0) const;
587 
591  Rectangle GetPosition(size_t in_layer) const;
592 
594  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
595 
597  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
598 
602  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
603 
607  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
608 
611  SegmentKey GetSegmentKey();
612  SegmentKey const GetSegmentKey() const;
613 
615  CanvasArray GetOwningCanvases();
616  CanvasArray const GetOwningCanvases() const;
617 
619  void Update() const;
620 
623  UpdateNotifier UpdateWithNotifier() const;
624 
628  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
629 
635  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
636 
637 };
638 
639 class SPRK_API CanvasDeletedEvent : public Event
640 {
641 public:
644  {
645  channel = GetClassID();
646  consumable = false;
647  }
648 
649  CanvasDeletedEvent(Canvas const & in_canvas)
650  : Event(), canvas(in_canvas)
651  {
652  channel = GetClassID();
653  consumable = false;
654  }
655 
658  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
659  {
660  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
661  {
662  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
663  canvas = that.canvas;
664  }
665  else
666  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
667  }
668 
670 
673  Event * Clone() const
674  {
675  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
676  return new_event;
677  }
678 
679  Canvas canvas;
680 };
681 
682 class SPRK_API LayoutDetachedEvent : public Event
683 {
684 public:
687  {
688  channel = GetClassID();
689  consumable = false;
690  }
691 
692  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
693  : Event(), canvas(in_canvas), layout(in_layout)
694  {
695  channel = GetClassID();
696  consumable = false;
697  }
698 
701  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
702  {
703  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
704  {
705  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
706  canvas = that.canvas;
707  layout = that.layout;
708  }
709  else
710  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
711  }
712 
714 
717  Event * Clone() const
718  {
719  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
720  return new_event;
721  }
722 
723  Canvas canvas;
724  Layout layout;
725 };
726 
727 class SPRK_API LayoutDeletedEvent : public Event
728 {
729 public:
732  {
733  channel = GetClassID();
734  consumable = false;
735  }
736 
737  LayoutDeletedEvent(Layout const & in_layout)
738  : Event(), layout(in_layout)
739  {
740  channel = GetClassID();
741  consumable = false;
742  }
743 
746  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
747  {
748  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
749  {
750  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
751  layout = that.layout;
752  }
753  else
754  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
755  }
756 
758 
761  Event * Clone() const
762  {
763  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
764  return new_event;
765  }
766 
767  Layout layout;
768 };
769 
770 class SPRK_API ViewDetachedEvent : public Event
771 {
772 public:
773  enum class Action
774  {
775  None = 0,
776  SpecificLayer,
777  AllLayers,
778  };
779 
781  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
782  {
783  channel = GetClassID();
784  consumable = false;
785  }
786 
787  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
788  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
789  {
790  channel = GetClassID();
791  consumable = false;
792  }
793 
794  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
795  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
796  {
797  channel = GetClassID();
798  consumable = false;
799  }
800 
803  ViewDetachedEvent(Event const & in_event) : Event(in_event)
804  {
805  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
806  {
807  auto that = static_cast<ViewDetachedEvent const &>(in_event);
808  layout = that.layout;
809  action = that.action;
810  layer = that.layer;
811  view = that.view;
812  }
813  else
814  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
815  }
816 
818 
821  Event * Clone() const
822  {
823  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
824  return new_event;
825  }
826 
827  Layout layout;
828  Action action;
829  size_t layer;
830  View view;
831 };
832 
833 class SPRK_API ViewDeletedEvent : public Event
834 {
835 public:
838  {
839  channel = GetClassID();
840  consumable = false;
841  }
842 
843  ViewDeletedEvent(View const & in_view)
844  : Event(), view(in_view)
845  {
846  channel = GetClassID();
847  consumable = false;
848  }
849 
852  ViewDeletedEvent(Event const & in_event) : Event(in_event)
853  {
854  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
855  {
856  auto that = static_cast<ViewDeletedEvent const &>(in_event);
857  view = that.view;
858  }
859  else
860  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
861  }
862 
863  ~ViewDeletedEvent();
864 
867  Event * Clone() const
868  {
869  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
870  return new_event;
871  }
872 
873  View view;
874 };
875 
876 class SPRK_API ModelDetachedEvent : public Event
877 {
878 public:
881  {
882  channel = GetClassID();
883  consumable = false;
884  }
885 
886  ModelDetachedEvent(View const & in_view, Model const & in_model)
887  : Event(), view(in_view), model(in_model)
888  {
889  channel = GetClassID();
890  consumable = false;
891  }
892 
895  ModelDetachedEvent(Event const & in_event) : Event(in_event)
896  {
897  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
898  {
899  auto that = static_cast<ModelDetachedEvent const &>(in_event);
900  view = that.view;
901  model = that.model;
902  }
903  else
904  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
905  }
906 
908 
911  Event * Clone() const
912  {
913  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
914  return new_event;
915  }
916 
917  View view;
918  Model model;
919 };
920 
921 class SPRK_API ModelDeletedEvent : public Event
922 {
923 public:
926  {
927  channel = GetClassID();
928  consumable = false;
929  }
930 
931  ModelDeletedEvent(Model const & in_model)
932  : Event(), model(in_model)
933  {
934  channel = GetClassID();
935  consumable = false;
936  }
937 
940  ModelDeletedEvent(Event const & in_event) : Event(in_event)
941  {
942  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
943  {
944  auto that = static_cast<ModelDeletedEvent const &>(in_event);
945  model = that.model;
946  }
947  else
948  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
949  }
950 
952 
955  Event * Clone() const
956  {
957  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
958  return new_event;
959  }
960 
961  Model model;
962 };
963 
964 class SPRK_API CameraChangedEvent : public Event
965 {
966 public:
969  {
970  channel = GetClassID();
971  consumable = false;
972  }
973 
974  CameraChangedEvent(View const & in_view)
975  : Event(), view(in_view)
976  {
977  channel = GetClassID();
978  consumable = false;
979  }
980 
983  CameraChangedEvent(Event const & in_event) : Event(in_event)
984  {
985  if (in_event.GetChannel() == Object::ClassID<CameraChangedEvent>())
986  {
987  auto that = static_cast<CameraChangedEvent const &>(in_event);
988  view = that.view;
989  }
990  else
991  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
992  }
993 
995 
996  virtual bool Drop(Event const * in_that_event) const
997  {
998  CameraChangedEvent const * that_event = static_cast<CameraChangedEvent const *>(in_that_event);
999 
1000  if (view == that_event->view)
1001  return true;
1002 
1003  return false;
1004  }
1005 
1006  virtual intptr_t Freshen() const
1007  {
1008  return GetClassID();
1009  }
1010 
1013  Event * Clone() const
1014  {
1015  CameraChangedEvent * new_event = new CameraChangedEvent(*this);
1016  return new_event;
1017  }
1018 
1019  View view;
1020 };
1021 
1024 class SPRK_API SprocketPath : public Sprocket
1025 {
1026 public:
1027  SprocketPath();
1028  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
1029  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
1030  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
1031  SprocketPath(SprocketPath const & that);
1032  ~SprocketPath();
1033 
1034  HPS::Type ObjectType() const { return HPS::Type::SprocketPath; }
1035 
1036  SprocketPath & operator=(SprocketPath const & in_that);
1037  void Set(SprocketPath const & in_that);
1038 
1039  bool Equals(SprocketPath const & in_that) const;
1040  bool operator!= (SprocketPath const & in_that) const;
1041  bool operator== (SprocketPath const & in_that) const;
1042 
1044  Canvas GetCanvas() const;
1045 
1047  Layout GetLayout() const;
1048 
1050  View GetView() const;
1051 
1053  Model GetModel() const;
1054 
1059  KeyPath GetKeyPath() const;
1060 };
1061 
1062 
1065 class SPRK_API Operator : public Sprocket
1066 {
1067 public:
1068  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1069  Operator(Operator const & in_that);
1070 
1071  virtual ~Operator();
1072 
1073  HPS::Type ObjectType() const { return HPS::Type::Operator; }
1074 
1075  virtual Operator & operator= (Operator const & in_that);
1076 
1078  virtual void Assign(Operator const & in_that);
1079 
1081  virtual bool Equals(Operator const & in_that) const;
1082 
1084  virtual bool operator!= (Operator const & in_that) const;
1085 
1087  virtual bool operator== (Operator const & in_that) const;
1088 
1090  void DetachView();
1091 
1093  View GetAttachedView() const;
1094 
1096  virtual UTF8 GetName() const { return "Operator"; }
1097 
1101  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1102 
1106  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1107 
1111  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1112 
1116  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1117 
1121  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1122 
1126  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1127 
1131  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1132 
1136  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1137 
1141  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1142 
1146  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1147 
1151  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1152 
1156  virtual bool OnTextInput(HPS::UTF8 const & in_text) { HPS_UNREFERENCED(in_text); return false; }
1157 
1161  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1162 
1164  virtual void OnViewAttached() { return; }
1165 
1167  virtual void OnViewDetached() { return; }
1168 
1171  virtual void OnModelAttached() { return; }
1172 
1175  virtual void OnModelDetached() { return; }
1176 
1178  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1179 
1182  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1183 
1187  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1188 
1190  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1191 
1193  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1194 
1195  enum class Priority
1196  {
1197  Low,
1198  Default,
1199  High
1200  };
1201 
1202 protected:
1203 
1204  HPS::MouseButtons mouse_trigger;
1205  HPS::ModifierKeys modifier_trigger;
1206 };
1207 
1210 class SPRK_API OperatorControl : public SprocketControl
1211 {
1212 public:
1214  explicit OperatorControl(View const & in_view);
1215 
1217  OperatorControl(OperatorControl const & in_that);
1218 
1222  OperatorControl(OperatorControl && in_that);
1223 
1227  OperatorControl & operator=(OperatorControl && in_that);
1228 
1230  ~OperatorControl();
1231 
1232  HPS::Type ObjectType() const {return HPS::Type::OperatorControl;};
1233 
1235  OperatorControl & operator=(OperatorControl const & in_that);
1236 
1237 
1239  size_t GetCount();
1240 
1243  size_t GetCount(Operator::Priority in_priority);
1244 
1245 
1251  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1252 
1258  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1259 
1263  bool Pop(Operator::Priority in_priority = Operator::Priority::Default);
1264 
1269  bool Pop(OperatorPtr & out_operator);
1270 
1276  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1277 
1278 
1284  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1285 
1291  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1292 
1298  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Default);
1299 
1306  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Default);
1307 
1308 
1312  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Default);
1313 
1317  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1318 
1321  OperatorControl & UnsetEverything();
1322 
1323 
1327  bool ShowTop(OperatorPtr & out_operator) const;
1328 
1333  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1334 
1338  bool Show(OperatorPtrArray & out_operators) const;
1339 
1344  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1345 
1346 private:
1348  OperatorControl() {}
1349 };
1350 
1354 {
1355 public:
1356 
1357  enum class Location
1358  {
1359  TopRight,
1360  TopLeft,
1361  BottomRight,
1362  BottomLeft,
1363  Custom,
1364  };
1365 
1367  explicit NavigationCubeControl(View const & in_view);
1368 
1371 
1376 
1380  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1381 
1384 
1385  HPS::Type ObjectType() const {return HPS::Type::NavigationCubeControl;};
1386 
1388  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1389 
1396  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1397 
1400  Location GetLocation() const;
1401 
1405  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1406 
1409  HPS::Rectangle GetPosition() const;
1410 
1415  NavigationCubeControl & SetVisibility(bool in_visibility);
1416 
1419  bool GetVisibility() const;
1420 
1424  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1425 
1428  bool GetTextVisibility() const;
1429 
1444  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1445 
1448  HPS::UTF8 GetMaterialPalette() const;
1449 
1457  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1458 
1459 
1462  bool GetInteractivity() const;
1463 
1468  NavigationCubeControl & SetSize(float in_size);
1469 
1472  float GetSize() const;
1473 
1476  HPS::SegmentKey GetSegmentKey() const;
1477 
1478 private:
1481 
1483  HPS::SegmentKey GetNavigationCubeSegment() const;
1484 };
1485 
1488 class SPRK_API AxisTriadControl : public SprocketControl
1489 {
1490 public:
1491 
1492  enum class Location
1493  {
1494  TopRight,
1495  TopLeft,
1496  BottomRight,
1497  BottomLeft,
1498  Custom,
1499  };
1500 
1502  explicit AxisTriadControl(View const & in_view);
1503 
1505  AxisTriadControl(AxisTriadControl const & in_that);
1506 
1510  AxisTriadControl(AxisTriadControl && in_that);
1511 
1515  AxisTriadControl & operator=(AxisTriadControl && in_that);
1516 
1518  ~AxisTriadControl();
1519 
1520  HPS::Type ObjectType() const {return HPS::Type::AxisTriadControl;};
1521 
1523  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1524 
1531  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1532 
1535  Location GetLocation() const;
1536 
1540  AxisTriadControl & SetPosition(HPS::Rectangle const & in_rectangle);
1541 
1544  HPS::Rectangle GetPosition() const;
1545 
1550  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1551 
1554  bool GetVisibility() const;
1555 
1559  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1560 
1563  bool GetTextVisibility() const;
1564 
1573  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1574 
1577  HPS::UTF8 GetMaterialPalette() const;
1578 
1585  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1586 
1589  bool GetInteractivity() const;
1590 
1595  AxisTriadControl & SetSize(float in_size);
1596 
1599  float GetSize() const;
1600 
1603  HPS::SegmentKey GetSegmentKey() const;
1604 
1605 private:
1607  AxisTriadControl(){};
1608 
1610  HPS::SegmentKey GetAxisTriadSegment() const;
1611 };
1612 
1614 class SPRK_API Component : public Sprocket
1615 {
1616 public:
1619  enum class ComponentType : uint32_t
1620  {
1621  None = 0x00000000,
1622  GenericMask = 0xfffff000,
1623 
1624  ExchangeComponentMask = 0x00001000,
1625  ExchangeModelFile = 0x00001001,
1626  ExchangeProductOccurrence = 0x00001002,
1627  ExchangePartDefinition = 0x00001003,
1628 
1629  ExchangeView = 0x00001004,
1630  ExchangeFilter = 0x00001005,
1631 
1632  ExchangeRepresentationItemMask = 0x00003000,
1633  ExchangeRIBRepModel = 0x00003001,
1634  ExchangeRICurve = 0x00003002,
1635  ExchangeRIDirection = 0x00003003,
1636  ExchangeRIPlane = 0x00003004,
1637  ExchangeRIPointSet = 0x00003005,
1638  ExchangeRIPolyBRepModel = 0x00003006,
1639  ExchangeRIPolyWire = 0x00003007,
1640  ExchangeRISet = 0x00003008,
1641  ExchangeRICoordinateSystem = 0x00003009,
1642 
1643  ExchangeTopologyMask = 0x00005000,
1644  ExchangeTopoBody = 0x00005001,
1645  ExchangeTopoConnex = 0x00005002,
1646  ExchangeTopoShell = 0x00005003,
1647  ExchangeTopoFace = 0x00005004,
1648  ExchangeTopoLoop = 0x00005005,
1649  ExchangeTopoCoEdge = 0x00005006,
1650  ExchangeTopoEdge = 0x00005007,
1651  ExchangeTopoVertex = 0x00005008,
1652  ExchangeTopoSingleWireBody = 0x00005009,
1653  ExchangeTopoWireEdge = 0x0000500a,
1654 
1655  ExchangeDrawingMask = 0x00006000,
1656  ExchangeDrawingModel = 0x00006001,
1657  ExchangeDrawingView = 0x00006002,
1658  ExchangeDrawingSheet = 0x00006003,
1659  ExchangeBasicDrawingBlock = 0x00006004,
1660  ExchangeOperatorDrawingBlock = 0x00006005,
1661 
1662  ExchangePMIMask = 0x00009000,
1663  ExchangePMI = ExchangePMIMask,
1664  ExchangePMIText = 0x00009100,
1665  ExchangePMIRichText = 0x00009200,
1666  ExchangePMIRoughness = 0x00009300,
1667  ExchangePMIGDT = 0x00009400,
1668  ExchangePMIDatum = 0x00009500,
1669  ExchangePMILineWelding = 0x00009600,
1670  ExchangePMISpotWelding = 0x00009700,
1671  ExchangePMIDimension = 0x00009800,
1672  ExchangePMIBalloon = 0x00009900,
1673  ExchangePMICoordinate = 0x00009a00,
1674  ExchangePMIFastener = 0x00009b00,
1675  ExchangePMILocator = 0x00009c00,
1676  ExchangePMIMeasurementPoint = 0x00009d00,
1677 
1678 
1679  ParasolidComponentMask = 0x00010000,
1680 
1681  ParasolidModelFile = 0x00010001,
1682  ParasolidAssembly = 0x00010002,
1683 
1684  ParasolidTopologyMask = 0x00050000,
1685  ParasolidTopoBody = 0x00050001,
1686  ParasolidTopoRegion = 0x00050002,
1687  ParasolidTopoShell = 0x00050003,
1688  ParasolidTopoFace = 0x00050004,
1689  ParasolidTopoLoop = 0x00050005,
1690  ParasolidTopoFin = 0x00050006,
1691  ParasolidTopoEdge = 0x00050007,
1692  ParasolidTopoVertex = 0x00050008,
1693 
1694 
1695  DWGComponentMask = 0x00100000,
1696  DWGModelFile = 0x00100001,
1697  DWGLayout = 0x00100002,
1698  DWGBlockTable = 0x00100003,
1699  DWGBlockTableRecord = 0x00100004,
1700  DWGEntity = 0x00100005,
1701  DWGLayerTable = 0x00100006,
1702  DWGLayer = 0x00100007,
1703  };
1704 
1705 
1707  Component();
1708 
1711  Component(Component const & in_that);
1712 
1715  Component(Component && in_that);
1716 
1718  virtual ~Component();
1719 
1720  HPS::Type ObjectType() const { return HPS::Type::Component; }
1721 
1722 
1726  Component & operator=(Component const & in_that);
1727 
1731  Component & operator=(Component && in_that);
1732 
1736  virtual void Assign(Component const & in_that);
1737 
1741  bool Equals(Component const & in_that) const;
1742 
1746  bool operator!=(Component const & in_that) const;
1747 
1751  bool operator==(Component const & in_that) const;
1752 
1753 
1756  ComponentType GetComponentType() const;
1757 
1761  bool HasComponentType(ComponentType in_mask) const;
1762 
1763 
1764 
1770  void AddKey(Key const & in_key);
1771 
1774  KeyArray GetKeys() const;
1775 
1776 
1777 
1782  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1783 
1787  ComponentArray GetOwners() const;
1788 
1791  ComponentArray GetSubcomponents() const;
1792 
1797  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1798 
1799 
1800 
1803  void AddReference(Component & in_reference);
1804 
1807  ComponentArray GetReferrers() const;
1808 
1812  ComponentArray GetReferences() const;
1813 
1814 
1815 
1818  MetadataArray GetAllMetadata() const;
1819 
1823  Metadata GetMetadata(char const * in_name) const;
1824 
1828  UTF8 GetName() const;
1829 
1830 
1831 
1836  void Delete();
1837 
1841  void Flush();
1842 
1843 
1851  static KeyPathArray GetKeyPath(Component const & in_component);
1852 
1862  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
1863 
1872  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
1873 };
1874 
1876 class SPRK_API ComponentPath : public Sprocket
1877 {
1878 public:
1880  ComponentPath();
1881 
1884  ComponentPath(ComponentArray const & in_components);
1885 
1889  ComponentPath(size_t in_count, Component const in_components[]);
1890 
1892  ComponentPath(ComponentPath const & in_that);
1893 
1897  ComponentPath(ComponentPath && in_that);
1898 
1902  ComponentPath & operator=(ComponentPath && in_that);
1903 
1905  virtual ~ComponentPath();
1906 
1907  HPS::Type ObjectType() const { return HPS::Type::ComponentPath; }
1908 
1912  ComponentPath & operator+=(Component const & in_component);
1913 
1917  ComponentPath & operator+=(ComponentPath const & in_path);
1918 
1922  ComponentPath & operator+=(ComponentArray const & in_components);
1923 
1927  ComponentPath & Append(Component const & in_component);
1928 
1932  ComponentPath & Append(ComponentPath const & in_path);
1933 
1937  ComponentPath & Append(ComponentArray const & in_components);
1938 
1942  ComponentPath & operator=(ComponentPath const & in_that);
1943 
1947  ComponentPath & operator=(ComponentArray const & in_path);
1948 
1951  void Set(ComponentPath const & in_that);
1952 
1956  bool Equals(ComponentPath const & in_that) const;
1957 
1961  bool operator!= (ComponentPath const & in_that) const;
1962 
1966  bool operator== (ComponentPath const & in_that) const;
1967 
1968 
1972  ComponentPath & SetComponents(ComponentArray const & in_components);
1973 
1978  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
1979 
1982  ComponentArray GetComponents() const;
1983 
1987  KeyPathArray GetKeyPaths() const;
1988 
1993  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
1994 
1995 
1999  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
2000 
2005  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
2006 
2010  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2011 
2016  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2017 
2018 
2022  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2023 
2027  void Show(Canvas const & in_canvas, size_t in_layer = 0);
2028 
2034  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
2035 
2039  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
2040 
2041  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0);
2042 };
2043 
2044 
2049 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2050 {
2051  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2052 }
2053 
2058 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2059 {
2060  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2061 }
2062 
2067 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2068 {
2069  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2070 }
2071 
2076 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2077 {
2078  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2079 }
2080 
2085 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2086 {
2087  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2088 }
2089 
2094 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2095 {
2096  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2097 }
2098 
2103 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2104 {
2105  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2106 }
2107 
2112 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2113 {
2114  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2115 }
2116 
2121 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2122 {
2123  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2124 }
2125 
2126 
2128 class SPRK_API ComponentHighlightEvent : public Event
2129 {
2130 public:
2131  enum class Action
2132  {
2133  None = 0,
2134  Highlight,
2135  Unhighlight,
2136  };
2137 
2140  {
2141  channel = GetClassID();
2142  consumable = false;
2143  action = Action::None;
2144  }
2145 
2146  ComponentHighlightEvent(Action in_action,
2147  ComponentPath const & in_path = ComponentPath(),
2148  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2149  : Event(), action(in_action), path(in_path), options(in_options)
2150  {
2151  channel = GetClassID();
2152  consumable = false;
2153  }
2154 
2157  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2158  {
2159  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2160  {
2161  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2162  action = that.action;
2163  path = that.path;
2164  options = that.options;
2165  }
2166  else
2167  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2168  }
2169 
2171 
2174  Event * Clone() const
2175  {
2176  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2177  return new_event;
2178  }
2179 
2180  Action action;
2181  ComponentPath path;
2182  HighlightOptionsKit options;
2183 };
2184 
2185 
2187 class SPRK_API Filter : public Component
2188 {
2189 public:
2191  Filter();
2192 
2196  Filter(Component const & in_that);
2197 
2200  Filter(Filter const & in_that);
2201 
2204  Filter(Filter && in_that);
2205 
2206  virtual ~Filter();
2207 
2208  HPS::Type ObjectType() const { return HPS::Type::Filter; }
2209 
2210 
2211 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2212  Filter & operator=(Filter const & in_that) = default;
2213 #endif
2214 
2218  Filter & operator=(Filter && in_that);
2219 
2220 
2223  void Activate(View const & in_view);
2224 
2227  void Deactivate(View const & in_view);
2228 };
2229 
2230 
2231 class SPRK_API FilterActivationEvent : public Event
2232 {
2233 public:
2234  enum class Action
2235  {
2236  None = 0,
2237  Activate,
2238  Deactivate,
2239  };
2240 
2243  {
2244  channel = GetClassID();
2245  consumable = false;
2246  }
2247 
2248  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2249  {
2250  channel = GetClassID();
2251  consumable = false;
2252  }
2253 
2256  FilterActivationEvent(Event const & in_event) : Event(in_event)
2257  {
2258  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2259  {
2260  auto that = static_cast<FilterActivationEvent const &>(in_event);
2261  filter = that.filter;
2262  action = that.action;
2263  view = that.view;
2264  }
2265  else
2266  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2267  }
2268 
2270 
2273  Event * Clone() const
2274  {
2275  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2276  return new_event;
2277  }
2278 
2279  Filter filter;
2280  Action action;
2281  View view;
2282 };
2283 
2284 
2286 class SPRK_API Capture : public Component
2287 {
2288 public:
2290  Capture();
2291 
2295  Capture(Component const & in_that);
2296 
2299  Capture(Capture const & in_that);
2300 
2303  Capture(Capture && in_that);
2304 
2305  virtual ~Capture();
2306 
2307  HPS::Type ObjectType() const { return HPS::Type::Capture; }
2308 
2309 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2310  Capture & operator=(Capture const & in_that) = default;
2311 #endif
2312 
2316  Capture & operator=(Capture && in_that);
2317 
2318 
2322  View Activate();
2323 };
2324 
2325 
2326 class SPRK_API CaptureActivationEvent : public Event
2327 {
2328 public:
2331  {
2332  channel = GetClassID();
2333  consumable = false;
2334  }
2335 
2336  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2337  {
2338  channel = GetClassID();
2339  consumable = false;
2340  }
2341 
2344  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2345  {
2346  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2347  {
2348  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2349  capture = that.capture;
2350  view = that.view;
2351  }
2352  else
2353  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2354  }
2355 
2357 
2360  Event * Clone() const
2361  {
2362  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2363  return new_event;
2364  }
2365 
2366  Capture capture;
2367  View view;
2368 };
2369 
2370 
2372 class SPRK_API CADModel : public Component
2373 {
2374 public:
2376  CADModel();
2377 
2381  CADModel(Component const & in_that);
2382 
2385  CADModel(CADModel const & in_that);
2386 
2389  CADModel(CADModel && in_that);
2390 
2393  CADModel(Model const & in_that);
2394 
2395  virtual ~CADModel();
2396 
2397  HPS::Type ObjectType() const { return HPS::Type::CADModel; }
2398 
2399 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2400  CADModel & operator=(CADModel const & in_that) = default;
2401 #endif
2402 
2406  CADModel & operator=(CADModel && in_that);
2407 
2408 
2412  Component GetComponentFromKey(Key const & in_key) const;
2413 
2418  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2419 
2425  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2426 
2427 
2430  Model GetModel() const;
2431 
2434  FilterArray GetAllFilters() const;
2435 
2438  CaptureArray GetAllCaptures() const;
2439 
2443  FilterArray GetActiveFilters(View const & in_view) const;
2444 
2445 
2449  View ActivateDefaultCapture();
2450 
2451 
2459  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2460 };
2461 
2462 
2463 
2466 class SPRK_API Metadata : public Sprocket
2467 {
2468 public:
2470  Metadata();
2471 
2474  Metadata(Metadata const & in_that);
2475 
2478  Metadata(Metadata && in_that);
2479 
2482  Metadata(char const * in_name);
2483 
2484  virtual ~Metadata();
2485 
2486  HPS::Type ObjectType() const { return HPS::Type::Metadata; }
2487 
2488 
2492  Metadata & operator=(Metadata const & in_that);
2493 
2497  Metadata & operator=(Metadata && in_that);
2498 
2502  virtual void Assign(Metadata const & in_that);
2503 
2507  bool Equals(Metadata const & in_that) const;
2508 
2512  bool operator!=(Metadata const & in_that) const;
2513 
2517  bool operator==(Metadata const & in_that) const;
2518 
2519 
2522  HPS::UTF8 GetName() const;
2523 
2526  void SetName(char const * in_name);
2527 };
2528 
2530 class SPRK_API IntegerMetadata : public Metadata
2531 {
2532 public:
2534  IntegerMetadata();
2535 
2539  IntegerMetadata(Metadata const & in_that);
2540 
2543  IntegerMetadata(IntegerMetadata const & in_that);
2544 
2547  IntegerMetadata(IntegerMetadata && in_that);
2548 
2552  IntegerMetadata(char const * in_name, int in_value);
2553 
2554  virtual ~IntegerMetadata();
2555 
2556  HPS::Type ObjectType() const { return HPS::Type::IntegerMetadata; }
2557 
2558 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2559  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2560 #endif
2561 
2565  IntegerMetadata & operator=(IntegerMetadata && in_that);
2566 
2567 
2570  int GetValue() const;
2571 
2574  void SetValue(int in_value);
2575 };
2576 
2578 class SPRK_API UnsignedIntegerMetadata : public Metadata
2579 {
2580 public:
2583 
2587  UnsignedIntegerMetadata(Metadata const & in_that);
2588 
2592 
2596 
2600  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2601 
2602  virtual ~UnsignedIntegerMetadata();
2603 
2604  HPS::Type ObjectType() const { return HPS::Type::UnsignedIntegerMetadata; }
2605 
2606 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2607  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2608 #endif
2609 
2613  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2614 
2615 
2618  unsigned int GetValue() const;
2619 
2622  void SetValue(unsigned int in_value);
2623 };
2624 
2626 class SPRK_API DoubleMetadata : public Metadata
2627 {
2628 public:
2630  DoubleMetadata();
2631 
2635  DoubleMetadata(Metadata const & in_that);
2636 
2639  DoubleMetadata(DoubleMetadata const & in_that);
2640 
2643  DoubleMetadata(DoubleMetadata && in_that);
2644 
2648  DoubleMetadata(char const * in_name, double in_value);
2649 
2650  virtual ~DoubleMetadata();
2651 
2652  HPS::Type ObjectType() const { return HPS::Type::DoubleMetadata; }
2653 
2654 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2655  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2656 #endif
2657 
2661  DoubleMetadata & operator=(DoubleMetadata && in_that);
2662 
2663 
2666  double GetValue() const;
2667 
2670  void SetValue(double in_value);
2671 };
2672 
2674 class SPRK_API StringMetadata : public Metadata
2675 {
2676 public:
2678  StringMetadata();
2679 
2683  StringMetadata(Metadata const & in_that);
2684 
2687  StringMetadata(StringMetadata const & in_that);
2688 
2691  StringMetadata(StringMetadata && in_that);
2692 
2696  StringMetadata(char const * in_name, char const * in_value);
2697 
2698  virtual ~StringMetadata();
2699 
2700  HPS::Type ObjectType() const { return HPS::Type::StringMetadata; }
2701 
2702 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2703  StringMetadata & operator=(StringMetadata const & in_that) = default;
2704 #endif
2705 
2709  StringMetadata & operator=(StringMetadata && in_that);
2710 
2711 
2714  UTF8 GetValue() const;
2715 
2718  void SetValue(char const * in_value);
2719 };
2720 
2722 class SPRK_API TimeMetadata : public Metadata
2723 {
2724 public:
2726  TimeMetadata();
2727 
2731  TimeMetadata(Metadata const & in_that);
2732 
2735  TimeMetadata(TimeMetadata const & in_that);
2736 
2739  TimeMetadata(TimeMetadata && in_that);
2740 
2744  TimeMetadata(char const * in_name, unsigned int in_value);
2745 
2746  virtual ~TimeMetadata();
2747 
2748  HPS::Type ObjectType() const { return HPS::Type::TimeMetadata; }
2749 
2750 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2751  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
2752 #endif
2753 
2757  TimeMetadata & operator=(TimeMetadata && in_that);
2758 
2759 
2762  unsigned int GetValue() const;
2763 
2766  HPS::UTF8 GetValueAsString() const;
2767 
2770  void SetValue(unsigned int in_value);
2771 };
2772 
2773 
2775 class SPRK_API BooleanMetadata : public Metadata
2776 {
2777 public:
2779  BooleanMetadata();
2780 
2784  BooleanMetadata(Metadata const & in_that);
2785 
2788  BooleanMetadata(BooleanMetadata const & in_that);
2789 
2792  BooleanMetadata(BooleanMetadata && in_that);
2793 
2797  BooleanMetadata(char const * in_name, bool in_value);
2798 
2799  virtual ~BooleanMetadata();
2800 
2801  HPS::Type ObjectType() const { return HPS::Type::BooleanMetadata; }
2802 
2803 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2804  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
2805 #endif
2806 
2810  BooleanMetadata & operator=(BooleanMetadata && in_that);
2811 
2812 
2815  bool GetValue() const;
2816 
2819  void SetValue(bool in_value);
2820 };
2821 
2822 
2823 
2825 class SPRK_API Factory : public Sprocket
2826 {
2827 public:
2828 
2831  static CanvasArray GetCanvases();
2832 
2835  static LayoutArray GetLayouts();
2836 
2839  static ViewArray GetViews();
2840 
2843  static ModelArray GetModels();
2844 
2847  static CADModelArray GetCADModels();
2848 
2854  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
2855 
2860  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
2861 
2867  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
2868 
2872  static Layout CreateLayout(char const * in_name = "");
2873 
2877  static View CreateView(char const * in_name = "");
2878 
2882  static Model CreateModel(char const * in_name = "");
2883 
2884 private:
2885  Factory() {}
2886 };
2887 
2897 class SPRK_API AxisTriadOperator : public Operator
2898 {
2899 public:
2900  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2902  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
2903 
2909  virtual bool OnMouseDown(MouseState const & in_state);
2914  virtual bool OnMouseUp(MouseState const & in_state);
2919  virtual bool OnMouseMove(MouseState const & in_state);
2920 
2925  virtual bool OnTouchDown(TouchState const & in_state);
2930  virtual bool OnTouchUp(TouchState const & in_state);
2935  virtual bool OnTouchMove(TouchState const & in_state);
2936 
2937  virtual void OnViewAttached();
2938  virtual void OnViewDetached();
2939 
2940 private:
2941 
2942  bool AxisOrbit(HPS::WindowPoint const & in_loc);
2943  void Transition(HPS::SelectionResults selection_results);
2944  void TranslatePoint(HPS::WindowPoint * point);
2945  bool IsEventRelevant(HPS::Point const & event_location);
2946 
2947  bool operator_active;
2948  HPS::WindowPoint start_point;
2949  HPS::Vector start_sphere_point;
2950  float axis_subwindow_width;
2951  float axis_subwindow_height;
2952  HPS::TouchID tracked_touch_ID;
2953  HPS::Rectangle axis_subwindow;
2954  HPS::SegmentKey axis_triad_segment;
2955 
2956 };
2957 
2960 {
2961 public:
2964  virtual ~SmoothTransitionCompleteEvent();
2965 
2968  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
2969  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
2970 
2973  Event * Clone() const
2974  {
2976  return new_event;
2977  }
2978 
2982  virtual bool Drop(Event const * in_that_event) const
2983  {
2984  HPS_UNREFERENCED(in_that_event);
2985  return false;
2986  }
2987 
2988  HPS::View view;
2989 };
2990 
3000 class SPRK_API NavigationCubeOperator : public Operator
3001 {
3002 public:
3003  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3004  ~NavigationCubeOperator() { OnViewDetached(); }
3005 
3007  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3008 
3013  virtual bool OnMouseDown(MouseState const & in_state);
3018  virtual bool OnMouseUp(MouseState const & in_state);
3023  virtual bool OnMouseMove(MouseState const & in_state);
3024 
3028  virtual bool OnTouchDown(TouchState const & in_state);
3033  virtual bool OnTouchUp(TouchState const & in_state);
3038  virtual bool OnTouchMove(TouchState const & in_state);
3039 
3040  virtual void OnViewAttached();
3041  virtual void OnViewDetached();
3042 
3043  virtual void OnModelAttached();
3044 
3045  void UpdateHighlightColor();
3046 
3050  void SetReferenceSegment(HPS::SegmentKey const & in_segment);
3051 
3056  void SetReferenceSegment(HPS::SegmentKeyArray const & in_segments);
3057 
3061  HPS::SegmentKeyArray ShowReferenceSegment();
3062 
3063 private:
3064  void Transition(HPS::SelectionResults selection_results);
3065  bool Orbit(HPS::WindowPoint const & in_loc);
3066  void TranslatePoint(HPS::WindowPoint * point);
3067  bool IsEventRelevant(HPS::Point const & event_location);
3068  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3069 
3070  bool operator_active;
3071  HPS::TouchID tracked_touch_ID;
3072  HPS::WindowPoint start_point;
3073  HPS::WindowPoint down_position;
3074  HPS::Vector start_sphere_point;
3075  HPS::SegmentKeyArray reference_segments; //rotation and zooming happen around these segments
3076 
3077  HPS::SegmentKey nav_cube_segment;
3078  HPS::SegmentKey style_segment;
3079  HPS::PortfolioKey portfolio;
3080  HPS::ReferenceKeyArrayArray groups;
3081  HPS::HighlightOptionsKit highlight_options_kit;
3082  HPS::CameraKit previous_camera;
3083  int previous_face;
3084  bool suppress_mouse_over_highlights;
3085 
3086  HPS::Rectangle nav_cube_subwindow;
3087  float nav_cube_subwindow_width;
3088  float nav_cube_subwindow_height;
3089 
3090  int highlighted_group;
3091 
3092  bool moving;
3093 
3094  class SmoothTransitionCompleteEventHandler : public EventHandler
3095  {
3096  public:
3097  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3098  : handler_view(in_view), handler_moving(&in_moving) {}
3099 
3100  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3101 
3102  virtual HandleResult Handle(HPS::Event const * in_event);
3103 
3104  private:
3105  View handler_view;
3106  bool * handler_moving;
3107  };
3108 
3109  SmoothTransitionCompleteEventHandler * handler;
3110 };
3111 
3112 
3113 
3114 
3115 class SceneTreeItem;
3116 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3117 class SceneTree;
3118 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3119 
3122 class SPRK_API SceneTree : public Sprocket
3123 {
3124 public:
3127  enum class ItemType : uint32_t
3128  {
3129  None = 0x00000000,
3130  GenericMask = 0xffff0000,
3131 
3132  Segment = 0x00000001,
3133  Include = 0x00000002,
3134  ConditionalExpression = 0x00000003,
3135  StaticModelSegment = 0x00000004,
3136  AttributeFilter = 0x00000005,
3137 
3138  Geometry = 0x00010000,
3139  CuttingSection = 0x00010001,
3140  Shell = 0x00010002,
3141  Mesh = 0x00010003,
3142  Grid = 0x00010004,
3143  NURBSSurface = 0x00010005,
3144  Cylinder = 0x00010006,
3145  Sphere = 0x00010007,
3146  Polygon = 0x00010008,
3147  Circle = 0x00010009,
3148  CircularWedge = 0x0001000a,
3149  Ellipse = 0x0001000b,
3150  Line = 0x0001000c,
3151  NURBSCurve = 0x0001000d,
3152  CircularArc = 0x0001000e,
3153  EllipticalArc = 0x0001000f,
3154  InfiniteLine = 0x00010010,
3155  InfiniteRay = 0x00010011,
3156  Marker = 0x00010012,
3157  Text = 0x00010013,
3158  Reference = 0x00010014,
3159  DistantLight = 0x00010015,
3160  Spotlight = 0x00010016,
3161 
3162  Attribute = 0x00020000,
3163  Portfolio = 0x00020001,
3164  SegmentStyle = 0x00020002,
3165  NamedStyle = 0x00020003,
3166  MaterialPalette = 0x00020004,
3167  Priority = 0x00020005,
3168  Material = 0x00020006,
3169  Camera = 0x00020007,
3170  ModellingMatrix = 0x00020008,
3171  UserData = 0x00020009,
3172  TextureMatrix = 0x0002000a,
3173  Culling = 0x0002000b,
3174  CurveAttribute = 0x0002000c,
3175  CylinderAttribute = 0x0002000d,
3176  EdgeAttribute = 0x0002000e,
3177  LightingAttribute = 0x0002000f,
3178  LineAttribute = 0x00020010,
3179  MarkerAttribute = 0x00020011,
3180  SurfaceAttribute = 0x00020012,
3181  Selectability = 0x00020013,
3182  SphereAttribute = 0x00020014,
3183  Subwindow = 0x00020015,
3184  TextAttribute = 0x00020016,
3185  Transparency = 0x00020017,
3186  Visibility = 0x00020018,
3187  VisualEffects = 0x00020019,
3188  Performance = 0x00020020,
3189  DrawingAttribute = 0x00020021,
3190  HiddenLineAttribute = 0x00020022,
3191  ContourLine = 0x00020023,
3192  Condition = 0x00020024,
3193  Bounding = 0x00020025,
3194  AttributeLock = 0x00020026,
3195  TransformMask = 0x00020027,
3196  ColorInterpolation = 0x00020028,
3197  CuttingSectionAttribute = 0x00020029,
3198 
3199  // window only attributes
3200  Debugging = 0x00020030,
3201  PostProcessEffects = 0x00020031,
3202  SelectionOptions = 0x00020032,
3203  UpdateOptions = 0x00020033,
3204 
3205  Definition = 0x00040000,
3206  NamedStyleDefinition = 0x00040001,
3207  TextureDefinition = 0x00040002,
3208  LinePatternDefinition = 0x00040003,
3209  GlyphDefinition = 0x00040004,
3210  CubeMapDefinition = 0x00040005,
3211  ImageDefinition = 0x00040006,
3212  MaterialPaletteDefinition = 0x00040007,
3213  ShaderDefinition = 0x00040008,
3214 
3215  Group = 0x00080000,
3216  SegmentGroup = 0x00080100,
3217  GeometryGroup = 0x00080200,
3218  AttributeGroup = 0x00080300,
3219  PortfolioGroup = 0x00080400,
3220  StyleGroup = 0x00080500,
3221  IncludeGroup = 0x00080600,
3222  DefinitionGroup = 0x00180000,
3223  NamedStyleDefinitionGroup = 0x00180700,
3224  TextureDefinitionGroup = 0x00180800,
3225  LinePatternDefinitionGroup = 0x00180900,
3226  GlyphDefinitionGroup = 0x00180a00,
3227  CubeMapDefinitionGroup = 0x00180b00,
3228  ImageDefinitionGroup = 0x00180c00,
3229  MaterialPaletteDefinitionGroup = 0x00180d00,
3230  ShaderDefinitionGroup = 0x00180e00,
3231  CuttingSectionGroup = 0x00080001,
3232  ShellGroup = 0x00080002,
3233  MeshGroup = 0x00080003,
3234  GridGroup = 0x00080004,
3235  NURBSSurfaceGroup = 0x00080005,
3236  CylinderGroup = 0x00080006,
3237  SphereGroup = 0x00080007,
3238  PolygonGroup = 0x00080008,
3239  CircleGroup = 0x00080009,
3240  CircularWedgeGroup = 0x0008000a,
3241  EllipseGroup = 0x0008000b,
3242  LineGroup = 0x0008000c,
3243  NURBSCurveGroup = 0x0008000d,
3244  CircularArcGroup = 0x0008000e,
3245  EllipticalArcGroup = 0x0008000f,
3246  InfiniteLineGroup = 0x00080010,
3247  InfiniteRayGroup = 0x00080011,
3248  MarkerGroup = 0x00080012,
3249  TextGroup = 0x00080013,
3250  ReferenceGroup = 0x00080014,
3251  DistantLightGroup = 0x00080015,
3252  SpotlightGroup = 0x00080016,
3253  };
3254 
3256  SceneTree();
3257 
3260  SceneTree(Canvas const & in_canvas);
3261 
3264  SceneTree(SceneTree const & in_that);
3265 
3268  SceneTree(SceneTree && in_that);
3269 
3270  virtual ~SceneTree();
3271 
3272  virtual HPS::Type ObjectType() const { return HPS::Type::SceneTree; }
3273 
3277  SceneTree & operator=(SceneTree const & in_that);
3278 
3282  SceneTree & operator=(SceneTree && in_that);
3283 
3287  virtual void Assign(SceneTree const & in_that);
3288 
3292  bool Equals(SceneTree const & in_that) const;
3293 
3297  bool operator!=(SceneTree const & in_that) const;
3298 
3302  bool operator==(SceneTree const & in_that) const;
3303 
3304 
3313  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3314 
3324  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3325 
3336  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3337 
3345  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3346 
3349  HighlightOptionsKitArray GetHighlightOptions() const;
3350 
3351 
3356  void SetGroupingLimit(size_t in_limit);
3357 
3360  size_t GetGroupingLimit() const;
3361 
3362 
3369  void SetRoot(SceneTreeItemPtr const & in_root);
3370 
3373  SceneTreeItemPtr GetRoot() const;
3374 
3375 
3378  virtual void Flush();
3379 };
3380 
3381 
3384 class SPRK_API SceneTreeItem : public Sprocket
3385 {
3386 public:
3388  SceneTreeItem();
3389 
3392  SceneTreeItem(SceneTreeItem const & in_that);
3393 
3396  SceneTreeItem(SceneTreeItem && in_that);
3397 
3403  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3404 
3410  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3411 
3417  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3418 
3424  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3425 
3433  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3434 
3435  virtual ~SceneTreeItem();
3436 
3437  HPS::Type ObjectType() const { return HPS::Type::SceneTreeItem; }
3438 
3442  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3443 
3447  SceneTreeItem & operator=(SceneTreeItem && in_that);
3448 
3452  virtual void Assign(SceneTreeItem const & in_that);
3453 
3457  bool Equals(SceneTreeItem const & in_that) const;
3458 
3462  bool operator!=(SceneTreeItem const & in_that) const;
3463 
3467  bool operator==(SceneTreeItem const & in_that) const;
3468 
3469 
3472  SceneTreePtr GetTree() const;
3473 
3476  UTF8 GetTitle() const;
3477 
3480  SceneTree::ItemType GetItemType() const;
3481 
3485  bool HasItemType(SceneTree::ItemType in_mask) const;
3486 
3489  Key GetKey() const;
3490 
3493  KeyPath GetKeyPath() const;
3494 
3497  bool HasChildren() const;
3498 
3499 
3508  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3509 
3510 
3513  virtual void Expand();
3514 
3517  virtual void Collapse();
3518 
3519 
3524  bool IsSelected() const;
3525 
3531  virtual void Select();
3532 
3538  virtual void Unselect();
3539 
3544  bool IsHighlightable() const;
3545 
3551  bool IsHighlighted() const;
3552 
3557  void Highlight(size_t in_highlight_options_index = 0);
3558 
3564  void Highlight(HighlightOptionsKit const & in_highlight_options);
3565 
3571  void Unhighlight(size_t in_highlight_options_index = 0);
3572 
3579  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3580 };
3581 
3582 
3583 
3584 class ComponentTreeItem;
3585 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3586 class ComponentTree;
3587 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3588 
3591 class SPRK_API ComponentTree : public Sprocket
3592 {
3593 public:
3596  enum class ItemType
3597  {
3598  None,
3599  ExchangeComponent,
3600  ExchangeModelFile,
3601 
3602  ExchangeViewGroup,
3603  ExchangeAnnotationViewGroup,
3604  ExchangePMIGroup,
3605  ExchangeModelGroup,
3606 
3607  ParasolidComponent,
3608  ParasolidModelFile,
3609 
3610  DWGComponent,
3611  DWGModelFile,
3612  };
3613 
3615  ComponentTree();
3616 
3620  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3621 
3624  ComponentTree(ComponentTree const & in_that);
3625 
3628  ComponentTree(ComponentTree && in_that);
3629 
3630  virtual ~ComponentTree();
3631 
3632  virtual HPS::Type ObjectType() const { return HPS::Type::ComponentTree; }
3633 
3637  ComponentTree & operator=(ComponentTree const & in_that);
3638 
3642  ComponentTree & operator=(ComponentTree && in_that);
3643 
3647  virtual void Assign(ComponentTree const & in_that);
3648 
3652  bool Equals(ComponentTree const & in_that) const;
3653 
3657  bool operator!=(ComponentTree const & in_that) const;
3658 
3662  bool operator==(ComponentTree const & in_that) const;
3663 
3664 
3673  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3674 
3684  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3685 
3696  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3697 
3707  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3708 
3711  HighlightOptionsKitArray GetHighlightOptions() const;
3712 
3713 
3720  void SetRoot(ComponentTreeItemPtr const & in_root);
3721 
3724  ComponentTreeItemPtr GetRoot() const;
3725 
3726 
3729  virtual void Flush();
3730 };
3731 
3732 
3735 class SPRK_API ComponentTreeItem : public Sprocket
3736 {
3737 public:
3740 
3743  ComponentTreeItem(ComponentTreeItem const & in_that);
3744 
3748 
3754  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
3755 
3762  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
3763 
3764  virtual ~ComponentTreeItem();
3765 
3766  HPS::Type ObjectType() const { return HPS::Type::ComponentTreeItem; }
3767 
3771  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
3772 
3776  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
3777 
3781  virtual void Assign(ComponentTreeItem const & in_that);
3782 
3786  bool Equals(ComponentTreeItem const & in_that) const;
3787 
3791  bool operator!=(ComponentTreeItem const & in_that) const;
3792 
3796  bool operator==(ComponentTreeItem const & in_that) const;
3797 
3798 
3799 
3802  ComponentTreePtr GetTree() const;
3803 
3806  UTF8 GetTitle() const;
3807 
3810  ComponentTree::ItemType GetItemType() const;
3811 
3814  Component GetComponent() const;
3815 
3818  bool HasChildren() const;
3819 
3822  ComponentPath GetPath() const;
3823 
3824 
3832  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
3833 
3834 
3837  virtual void Expand();
3838 
3841  virtual void Collapse();
3842 
3843 
3849  bool IsHighlighted() const;
3850 
3855  virtual void OnHighlight(HighlightOptionsKit const & in_options);
3856 
3861  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
3862 
3863 
3868  void Highlight(size_t in_highlight_options_index = 0);
3869 
3875  void Highlight(HighlightOptionsKit const & in_highlight_options);
3876 
3881  void Unhighlight(size_t in_highlight_options_index = 0);
3882 
3888  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3889 
3890 
3900  bool IsHidden() const;
3901 
3905  virtual void OnHide();
3906 
3910  virtual void OnShow();
3911 
3915  void Hide();
3916 
3920  void Show();
3921 
3926  void Isolate();
3927 
3930  bool IsExpanded() const;
3931 };
3932 
3933 
3934 
3935 
3936 }
3937 #endif
3938 
3939 
3940 
Definition: sprk.h:2722
HPS::Type ObjectType() const
Definition: sprk.h:2556
Definition: hps.h:6070
Definition: sprk.h:964
HPS::Type ObjectType() const
Definition: sprk.h:452
Event * Clone() const
Definition: sprk.h:717
Definition: sprk.h:2897
Definition: sprk.h:237
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2157
HPS::Type ObjectType() const
Definition: sprk.h:245
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1161
Definition: hps.h:38650
ComponentHighlightEvent()
Definition: sprk.h:2139
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1187
Definition: hps.h:474
CameraChangedEvent(Event const &in_event)
Definition: sprk.h:983
HPS::Type ObjectType() const
Definition: sprk.h:210
HPS::Type ObjectType() const
Definition: sprk.h:1073
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1146
HPS::Type ObjectType() const
Definition: sprk.h:2208
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5579
Location
Definition: sprk.h:1357
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1190
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1151
ItemType
Definition: sprk.h:3596
Definition: hps.h:5619
virtual intptr_t Freshen() const
Definition: sprk.h:1006
CaptureActivationEvent()
Definition: sprk.h:2330
Definition: sprk.h:66
Definition: sprk.h:207
Definition: sprk.h:639
Definition: sprk.h:100
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1111
Definition: sprk.h:3735
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1121
Definition: sprk.h:2775
HPS::Type ObjectType() const
Definition: sprk.h:2397
Definition: hps.h:38437
Definition: hps.h:1309
Definition: hps.h:1027
HPS::Type ObjectType() const
Definition: sprk.h:1907
Definition: hps.h:1639
ModelDeletedEvent()
Definition: sprk.h:925
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:2968
Definition: sprk.h:3591
Definition: hps.h:42942
Definition: sprk.h:1024
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1136
Definition: hps.h:7445
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1182
virtual HPS::Type ObjectType() const
Definition: sprk.h:3272
Definition: hps.h:3434
Definition: hps.h:1968
Definition: sprk.h:876
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:761
Definition: sprk.h:727
Definition: hps.h:1377
Definition: hps.h:848
HPS::Type ObjectType() const
Definition: sprk.h:1520
Definition: hps.h:38555
virtual void OnModelDetached()
Definition: sprk.h:1175
Definition: hps.h:1686
Definition: hps.h:1497
Definition: hps.h:8612
Definition: hps.h:248
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1178
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1738
Event * Clone() const
Definition: sprk.h:867
CameraChangedEvent()
Definition: sprk.h:968
Definition: hps.h:42841
Definition: hps.h:37546
Definition: sprk.h:1353
Definition: sprk.h:921
Definition: sprk.h:524
HPS::Type ObjectType() const
Definition: sprk.h:107
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:803
virtual void OnViewDetached()
Definition: sprk.h:1167
Definition: hps.h:37592
HPS::Type ObjectType() const
Definition: sprk.h:3437
LayoutDeletedEvent()
Definition: sprk.h:731
Event * Clone() const
Definition: sprk.h:911
virtual void OnViewAttached()
Definition: sprk.h:1164
Definition: hps.h:37021
Definition: hps.h:39846
Definition: hps.h:1067
Definition: sprk.h:2466
LayoutDetachedEvent()
Definition: sprk.h:686
Definition: sprk.h:2578
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1126
Definition: hps.h:9342
Definition: hps.h:38598
Definition: hps.h:1456
SmoothTransitionCompleteEvent()
Definition: sprk.h:2963
Definition: hps.h:1397
HPS::Type ObjectType() const
Definition: sprk.h:531
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1106
FilterActivationEvent()
Definition: sprk.h:2242
Definition: hps.h:1416
virtual void OnModelAttached()
Definition: sprk.h:1171
Definition: hps.h:35443
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2256
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:895
HPS::Type ObjectType() const
Definition: sprk.h:1385
HPS::Type ObjectType() const
Definition: sprk.h:1720
Definition: hps.h:6818
Location
Definition: sprk.h:1492
Definition: hps.h:42333
Definition: sprk.h:2530
Definition: sprk.h:1488
Definition: hps.h:40023
HPS::Type ObjectType() const
Definition: sprk.h:1232
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:227
Definition: hps.h:41387
virtual UTF8 GetName() const
Definition: sprk.h:1096
Definition: hps.h:42729
Definition: sprk.h:682
Event * Clone() const
Definition: sprk.h:2273
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2344
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1131
HPS::Type ObjectType() const
Definition: sprk.h:2652
CanvasDeletedEvent()
Definition: sprk.h:643
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1116
HPS::Type ObjectType() const
Definition: sprk.h:2486
HPS::Type ObjectType() const
Definition: sprk.h:2604
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:222
Event * Clone() const
Definition: sprk.h:2360
UpdateType
Definition: hps.h:182
Definition: hps.h:14566
ViewDeletedEvent()
Definition: sprk.h:837
intptr_t GetChannel() const
Definition: hps.h:6203
Definition: sprk.h:770
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:2982
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2902
Definition: sprk.h:1614
Definition: hps.h:40300
Definition: hps.h:41998
virtual bool OnTextInput(HPS::UTF8 const &in_text)
Definition: sprk.h:1156
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:852
Definition: hps.h:35040
Definition: sprk.h:2674
ViewDetachedEvent()
Definition: sprk.h:781
Definition: hps.h:6170
Definition: sprk.h:1210
Definition: hps.h:410
HPS::Type ObjectType() const
Definition: sprk.h:2700
Event * Clone() const
Definition: sprk.h:2174
Definition: sprk.h:445
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:658
Definition: sprk.h:3000
Definition: sprk.h:1876
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:996
ComponentType
Definition: sprk.h:1619
Definition: hps.h:41313
Definition: hps.h:1987
Definition: sprk.h:2128
Event * Clone() const
Definition: sprk.h:673
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:701
HPS::Type ObjectType() const
Definition: sprk.h:3766
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1101
ItemType
Definition: sprk.h:3127
Definition: sprk.h:2187
Definition: sprk.h:2825
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3007
Definition: sprk.h:184
Definition: sprk.h:2959
Definition: hps.h:429
Event * Clone() const
Definition: sprk.h:955
Definition: sprk.h:2286
Definition: hps.h:2003
ModelDetachedEvent()
Definition: sprk.h:880
static MouseButtons ButtonLeft()
Definition: hps.h:42451
virtual HPS::Type ObjectType() const
Definition: sprk.h:3632
Definition: sprk.h:3122
Definition: sprk.h:2626
Definition: hps.h:8728
HPS::Type ObjectType() const
Definition: sprk.h:1034
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1193
Definition: hps.h:7364
Definition: sprk.h:2231
Definition: hps.h:34656
Definition: hps.h:355
Event * Clone() const
Definition: sprk.h:2973
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:940
Event * Clone() const
Definition: sprk.h:821
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:746
Definition: hps.h:8942
Definition: hps.h:10379
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1141
Definition: sprk.h:3384
Definition: sprk.h:2372
Mode
Definition: sprk.h:189
Definition: hps.h:515
Definition: sprk.h:1065
Definition: hps.h:1110
Definition: hps.h:38482
Definition: sprk.h:833
Definition: sprk.h:2326
Definition: hps.h:37084
HPS::Type ObjectType() const
Definition: sprk.h:2748
HPS::Type ObjectType() const
Definition: sprk.h:2307
HPS::Type ObjectType() const
Definition: sprk.h:2801
Definition: hps.h:7076
Event * Clone() const
Definition: sprk.h:1013