API Search || Global Search
sprk.h
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef SPRK_H
11 #define SPRK_H
12 
13 #include "hps.h"
14 
15 #include <memory>
16 
17 #ifdef _MSC_VER
18 # pragma warning(disable: 4251) //Not an issue as long as debug and release libraries aren't mixed
19 #ifndef STATIC_APP
20 # ifdef SPRK
21 # define SPRK_API __declspec (dllexport)
22 # else
23 # define SPRK_API __declspec (dllimport)
24 # endif
25 #endif
26 #else
27 # include <stddef.h>
28 # if defined(LINUX_SYSTEM) && defined(SPRK)
29 # ifndef STATIC_APP
30 # define SPRK_API __attribute__ ((visibility ("default")))
31 # endif
32 # endif
33 #endif
34 
35 #ifndef SPRK_API
36 # define SPRK_API
37 #endif
38 namespace SPRKI
39 {
40  class X;
41 };
42 
43 namespace HPS
44 {
45 
46 class Factory;
47 class Canvas;
48 class Layout;
49 class View;
50 class Model;
51 class Operator;
52 class OperatorControl;
53 class NavigationCubeControl;
54 class AxisTriadControl;
55 class Component;
56 class ComponentPath;
57 class ComponentHighlightEvent;
58 class Filter;
59 class Capture;
60 class CADModel;
61 class Metadata;
62 
63 
64 
65 
66 class SPRK_API Sprocket : public HPS::Object
67 {
68 public:
69  Sprocket() {}
70 #if !defined(_MSC_VER) || _MSC_VER >= 1900
71  Sprocket(HPS::Sprocket const & in_that) = default;
72 #endif
73  Sprocket(Sprocket && in_that) : HPS::Object(std::move(in_that)) {}
74 
75  virtual ~Sprocket() {}
76 };
77 
78 typedef std::shared_ptr<Operator> OperatorPtr;
79 
80 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
81 
82 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
83 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
84 typedef std::vector<View, Allocator<View> > ViewArray;
85 typedef std::vector<Model, Allocator<Model> > ModelArray;
86 
87 typedef std::vector<Component, Allocator<Component> > ComponentArray;
88 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
89 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
90 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
91 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
92 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
93 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
94 typedef std::vector<HighlightOptionsKit, Allocator<HighlightOptionsKit>> HighlightOptionsKitArray;
95 
96 
100 class SPRK_API Canvas : public Sprocket
101 {
102 public:
103  Canvas();
104  Canvas(Canvas const & that);
105  ~Canvas();
106 
107  static const HPS::Type staticType = HPS::Type::Canvas;
108  HPS::Type ObjectType() const { return staticType; }
109 
111  void Delete();
112 
113  Canvas & operator=(Canvas const & in_that);
114  void Assign(Canvas const & in_that);
115 
116  bool Equals(Canvas const & in_that) const;
117  bool operator!= (Canvas const & in_that) const;
118  bool operator== (Canvas const & in_that) const;
119 
121  UTF8 GetName() const;
122 
126  void AttachLayout(Layout const & in_layout);
127 
131  void AttachViewAsLayout(View const & in_view);
132 
134  void DetachLayout();
135 
137  Layout GetAttachedLayout() const;
138 
140  IncludeKey GetAttachedLayoutIncludeLink() const;
141 
143  View GetFrontView() const;
144 
145  WindowKey const GetWindowKey() const;
146 
149  WindowKey GetWindowKey();
150 
151  PortfolioKey const GetPortfolioKey() const;
152 
154  PortfolioKey GetPortfolioKey();
155 
157  void Update() const;
158 
161  UpdateNotifier UpdateWithNotifier() const;
162 
166  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
167 
172  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
173 
177  void SetFrameRate(float in_frame_rate=20);
178 
182  float GetFrameRate() const;
183 };
184 
185 class SPRK_API Rendering
186 {
187 public:
190  enum class Mode
191  {
192  Gouraud,
193  GouraudWithLines,
194  Flat,
195  FlatWithLines,
196  Phong,
197  PhongWithLines,
198  HiddenLine,
199  FastHiddenLine,
200  Wireframe,
201  Default = Phong
202  };
203 
204 private:
205  Rendering() {}
206 };
207 
208 class SPRK_API SprocketControl : public Sprocket
209 {
210 public:
211  static const HPS::Type staticType = HPS::Type::SprocketControl;
212  HPS::Type ObjectType() const {return staticType;}
213 
214 #if !defined(_MSC_VER) || _MSC_VER >= 1900
215  SprocketControl(HPS::SprocketControl const & in_that) = default;
216 #endif
217 
218 protected:
219  SprocketControl() {}
220 
224  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
225 
230  {
231  this->Object::operator=(std::move(in_that));
232  return *this;
233  }
234 };
235 
236 class SPRK_API SprocketKit : public Sprocket
237 {
238 public:
239  static const HPS::Type staticType = HPS::Type::SprocketKit;
240  HPS::Type ObjectType() const { return staticType; }
241 
242 #if !defined(_MSC_VER) || _MSC_VER >= 1900
243  SprocketKit(HPS::SprocketKit const & in_that) = default;
244 #endif
245 
246 protected:
247  SprocketKit() {}
248 
252  SprocketKit(SprocketKit && in_that) : Sprocket(std::move(in_that)) {}
253 
258  {
259  this->Object::operator=(std::move(in_that));
260  return *this;
261  }
262 };
263 
267 class SPRK_API View : public Sprocket
268 {
269 public:
270  View();
271  View(View const & that);
272  explicit View(SprocketControl const & in_ctrl);
273  ~View();
274 
275  static const HPS::Type staticType = HPS::Type::View;
276  HPS::Type ObjectType() const { return staticType; }
277 
279  void Delete();
280 
281  View & operator=(View const & in_that);
282  void Assign(View const & in_that);
283 
284  bool Equals(View const & in_that) const;
285  bool operator!= (View const & in_that) const;
286  bool operator== (View const & in_that) const;
287 
289  UTF8 GetName() const;
290 
291 
294  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
295 
299  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
300 
301 
305  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
306 
312  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
313 
314 
320  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
321 
322 
324  HPS::View & FitWorld();
325 
328  HPS::View & FitWorld(SegmentKey const & in_segment);
329 
330 
333  HPS::View & FitWorld(BoundingKit const & in_bounding);
334 
339  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
340 
341 
346  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
347 
352  void AttachModel(Model const & in_model);
353 
355  void DetachModel();
356 
358  Model GetAttachedModel() const;
359 
361  IncludeKey GetAttachedModelIncludeLink() const;
362 
366  void SetRenderingMode(Rendering::Mode in_mode);
367 
370  Rendering::Mode GetRenderingMode() const;
371 
373  OperatorPtrArray GetOperators() const;
374 
377  void SetOperators(OperatorPtrArray & in_operators);
378 
382  void SetOperators(size_t in_count, OperatorPtr in_operators []);
383 
386  void SetOperator(OperatorPtr const & in_operator);
387 
391  void SetOperator(Operator * in_operator);
392 
394  OperatorControl GetOperatorControl();
395  OperatorControl const GetOperatorControl() const;
396 
398  NavigationCubeControl GetNavigationCubeControl();
399  NavigationCubeControl const GetNavigationCubeControl() const;
400 
402  AxisTriadControl GetAxisTriadControl();
403  AxisTriadControl const GetAxisTriadControl() const;
404 
407  SegmentKey GetSegmentKey();
408  SegmentKey const GetSegmentKey() const;
409 
412  SegmentKey GetModelOverrideSegmentKey();
413  SegmentKey const GetModelOverrideSegmentKey() const;
414 
415 
416  PortfolioKey const GetPortfolioKey() const;
417 
419  PortfolioKey GetPortfolioKey();
420 
425  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
426 
428  bool GetSimpleShadow();
429 
434  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
435 
437  bool GetSimpleReflection();
438 
440  void Update() const;
441 
444  UpdateNotifier UpdateWithNotifier() const;
445 
449  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
450 
456  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
457 
461  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
462 
463  static UTF8 GetHideStyleName();
464  static UTF8 GetShowStyleName();
465 
467  KeyArray const GetNavigationKeys();
468 
470  LayoutArray GetOwningLayouts();
471  LayoutArray const GetOwningLayouts() const;
472 };
473 
477 class SPRK_API Model : public Sprocket
478 {
479 public:
480  Model();
481  Model(Model const & that);
482  ~Model();
483 
484  static const HPS::Type staticType = HPS::Type::Model;
485  HPS::Type ObjectType() const { return staticType; }
486 
488  void Delete();
489 
490  Model & operator=(Model const & in_that);
491  void Assign(Model const & in_that);
492 
493  bool Equals(Model const & in_that) const;
494  bool operator!= (Model const & in_that) const;
495  bool operator== (Model const & in_that) const;
496 
498  UTF8 GetName() const;
499 
502  SegmentKey GetSegmentKey();
503  SegmentKey const GetSegmentKey() const;
504 
506  SegmentKey GetLibraryKey();
507  SegmentKey const GetLibraryKey() const;
508 
510  PortfolioKey GetPortfolioKey();
511  PortfolioKey const GetPortfolioKey() const;
512 
514  HPS::Vector GetUpVector();
515  HPS::Vector const GetUpVector() const;
516 
518  HPS::Vector GetFrontVector();
519  HPS::Vector const GetFrontVector() const;
520 
522  HPS::ViewArray GetOwningViews();
523  HPS::ViewArray const GetOwningViews() const;
524 
528  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
529 
531  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector) const;
532 
534  void Update() const;
535 
538  UpdateNotifier UpdateWithNotifier() const;
539 
543  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
544 
550  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
551 
552 };
553 
557 class SPRK_API Layout : public Sprocket
558 {
559 public:
560  Layout();
561  Layout(Layout const & that);
562  ~Layout();
563 
564  static const HPS::Type staticType = HPS::Type::Layout;
565  HPS::Type ObjectType() const { return staticType; }
566 
568  void Delete();
569 
570  Layout & operator=(Layout const & in_that);
571  void Assign(Layout const & in_that);
572 
573  bool Equals(Layout const & in_that) const;
574  bool operator!= (Layout const & in_that) const;
575  bool operator== (Layout const & in_that) const;
576 
578  UTF8 GetName() const;
579 
581  size_t GetLayerCount() const;
582 
586  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
590  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
591 
594  void DetachLayer(size_t in_layer);
595 
598  void DetachView(View const & in_view); // everywhere it occurs
599 
602  void BringToFront(size_t in_layer);
603 
607  void ReassignLayer(size_t in_layer, HPS::View in_view);
608 
612  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
613 
615  View GetFrontView() const;
616 
620  View GetAttachedView(size_t in_layer = 0) const;
621 
625  Rectangle GetPosition(size_t in_layer) const;
626 
628  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
629 
631  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
632 
636  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
637 
641  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
642 
645  SegmentKey GetSegmentKey();
646  SegmentKey const GetSegmentKey() const;
647 
649  CanvasArray GetOwningCanvases();
650  CanvasArray const GetOwningCanvases() const;
651 
653  void Update() const;
654 
657  UpdateNotifier UpdateWithNotifier() const;
658 
662  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
663 
669  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
670 
671 };
672 
673 class SPRK_API CanvasDeletedEvent : public Event
674 {
675 public:
678  {
679  channel = GetClassID();
680  consumable = false;
681  }
682 
683  CanvasDeletedEvent(Canvas const & in_canvas)
684  : Event(), canvas(in_canvas)
685  {
686  channel = GetClassID();
687  consumable = false;
688  }
689 
692  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
693  {
694  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
695  {
696  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
697  canvas = that.canvas;
698  }
699  else
700  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
701  }
702 
704 
707  Event * Clone() const
708  {
709  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
710  return new_event;
711  }
712 
713  Canvas canvas;
714 };
715 
716 class SPRK_API LayoutDetachedEvent : public Event
717 {
718 public:
721  {
722  channel = GetClassID();
723  consumable = false;
724  }
725 
726  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
727  : Event(), canvas(in_canvas), layout(in_layout)
728  {
729  channel = GetClassID();
730  consumable = false;
731  }
732 
735  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
736  {
737  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
738  {
739  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
740  canvas = that.canvas;
741  layout = that.layout;
742  }
743  else
744  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
745  }
746 
748 
751  Event * Clone() const
752  {
753  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
754  return new_event;
755  }
756 
757  Canvas canvas;
758  Layout layout;
759 };
760 
761 class SPRK_API LayoutDeletedEvent : public Event
762 {
763 public:
766  {
767  channel = GetClassID();
768  consumable = false;
769  }
770 
771  LayoutDeletedEvent(Layout const & in_layout)
772  : Event(), layout(in_layout)
773  {
774  channel = GetClassID();
775  consumable = false;
776  }
777 
780  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
781  {
782  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
783  {
784  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
785  layout = that.layout;
786  }
787  else
788  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
789  }
790 
792 
795  Event * Clone() const
796  {
797  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
798  return new_event;
799  }
800 
801  Layout layout;
802 };
803 
804 class SPRK_API ViewDetachedEvent : public Event
805 {
806 public:
807  enum class Action
808  {
809  None = 0,
810  SpecificLayer,
811  AllLayers,
812  };
813 
815  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
816  {
817  channel = GetClassID();
818  consumable = false;
819  }
820 
821  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
822  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
823  {
824  channel = GetClassID();
825  consumable = false;
826  }
827 
828  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
829  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
830  {
831  channel = GetClassID();
832  consumable = false;
833  }
834 
837  ViewDetachedEvent(Event const & in_event) : Event(in_event)
838  {
839  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
840  {
841  auto that = static_cast<ViewDetachedEvent const &>(in_event);
842  layout = that.layout;
843  action = that.action;
844  layer = that.layer;
845  view = that.view;
846  }
847  else
848  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
849  }
850 
852 
855  Event * Clone() const
856  {
857  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
858  return new_event;
859  }
860 
861  Layout layout;
862  Action action;
863  size_t layer;
864  View view;
865 };
866 
867 class SPRK_API ViewDeletedEvent : public Event
868 {
869 public:
872  {
873  channel = GetClassID();
874  consumable = false;
875  }
876 
877  ViewDeletedEvent(View const & in_view)
878  : Event(), view(in_view)
879  {
880  channel = GetClassID();
881  consumable = false;
882  }
883 
886  ViewDeletedEvent(Event const & in_event) : Event(in_event)
887  {
888  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
889  {
890  auto that = static_cast<ViewDeletedEvent const &>(in_event);
891  view = that.view;
892  }
893  else
894  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
895  }
896 
897  ~ViewDeletedEvent();
898 
901  Event * Clone() const
902  {
903  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
904  return new_event;
905  }
906 
907  View view;
908 };
909 
910 class SPRK_API ModelDetachedEvent : public Event
911 {
912 public:
915  {
916  channel = GetClassID();
917  consumable = false;
918  }
919 
920  ModelDetachedEvent(View const & in_view, Model const & in_model)
921  : Event(), view(in_view), model(in_model)
922  {
923  channel = GetClassID();
924  consumable = false;
925  }
926 
929  ModelDetachedEvent(Event const & in_event) : Event(in_event)
930  {
931  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
932  {
933  auto that = static_cast<ModelDetachedEvent const &>(in_event);
934  view = that.view;
935  model = that.model;
936  }
937  else
938  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
939  }
940 
942 
945  Event * Clone() const
946  {
947  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
948  return new_event;
949  }
950 
951  View view;
952  Model model;
953 };
954 
955 class SPRK_API ModelDeletedEvent : public Event
956 {
957 public:
960  {
961  channel = GetClassID();
962  consumable = false;
963  }
964 
965  ModelDeletedEvent(Model const & in_model)
966  : Event(), model(in_model)
967  {
968  channel = GetClassID();
969  consumable = false;
970  }
971 
974  ModelDeletedEvent(Event const & in_event) : Event(in_event)
975  {
976  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
977  {
978  auto that = static_cast<ModelDeletedEvent const &>(in_event);
979  model = that.model;
980  }
981  else
982  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
983  }
984 
986 
989  Event * Clone() const
990  {
991  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
992  return new_event;
993  }
994 
995  Model model;
996 };
997 
998 class SPRK_API CameraChangedEvent : public Event
999 {
1000 public:
1003  {
1004  channel = GetClassID();
1005  consumable = false;
1006  }
1007 
1008  CameraChangedEvent(View const & in_view)
1009  : Event(), view(in_view)
1010  {
1011  channel = GetClassID();
1012  consumable = false;
1013  }
1014 
1017  CameraChangedEvent(Event const & in_event) : Event(in_event)
1018  {
1019  if (in_event.GetChannel() == Object::ClassID<CameraChangedEvent>())
1020  {
1021  auto that = static_cast<CameraChangedEvent const &>(in_event);
1022  view = that.view;
1023  }
1024  else
1025  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
1026  }
1027 
1028  ~CameraChangedEvent();
1029 
1030  virtual bool Drop(Event const * in_that_event) const
1031  {
1032  CameraChangedEvent const * that_event = static_cast<CameraChangedEvent const *>(in_that_event);
1033 
1034  if (view == that_event->view)
1035  return true;
1036 
1037  return false;
1038  }
1039 
1040  virtual intptr_t Freshen() const
1041  {
1042  return GetClassID();
1043  }
1044 
1047  Event * Clone() const
1048  {
1049  CameraChangedEvent * new_event = new CameraChangedEvent(*this);
1050  return new_event;
1051  }
1052 
1053  View view;
1054 };
1055 
1058 class SPRK_API SprocketPath : public Sprocket
1059 {
1060 public:
1061  SprocketPath();
1062  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
1063  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
1064  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
1065  SprocketPath(SprocketPath const & that);
1066  ~SprocketPath();
1067 
1068  static const HPS::Type staticType = HPS::Type::SprocketPath;
1069  HPS::Type ObjectType() const { return staticType; }
1070 
1071  SprocketPath & operator=(SprocketPath const & in_that);
1072  void Set(SprocketPath const & in_that);
1073 
1074  bool Equals(SprocketPath const & in_that) const;
1075  bool operator!= (SprocketPath const & in_that) const;
1076  bool operator== (SprocketPath const & in_that) const;
1077 
1079  Canvas GetCanvas() const;
1080 
1082  Layout GetLayout() const;
1083 
1085  View GetView() const;
1086 
1088  Model GetModel() const;
1089 
1094  KeyPath GetKeyPath() const;
1095 };
1096 
1097 
1100 class SPRK_API Operator : public Sprocket
1101 {
1102 public:
1103  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1104  Operator(Operator const & in_that);
1105 
1106  virtual ~Operator();
1107 
1108  static const HPS::Type staticType = HPS::Type::Operator;
1109  HPS::Type ObjectType() const { return staticType; }
1110 
1111  virtual Operator & operator= (Operator const & in_that);
1112 
1114  virtual void Assign(Operator const & in_that);
1115 
1117  virtual bool Equals(Operator const & in_that) const;
1118 
1120  virtual bool operator!= (Operator const & in_that) const;
1121 
1123  virtual bool operator== (Operator const & in_that) const;
1124 
1126  void DetachView();
1127 
1129  View GetAttachedView() const;
1130 
1132  virtual UTF8 GetName() const { return "Operator"; }
1133 
1137  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1138 
1142  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1143 
1147  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1148 
1152  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1153 
1157  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1158 
1162  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1163 
1167  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1168 
1172  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1173 
1177  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1178 
1182  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1183 
1187  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1188 
1192  virtual bool OnTextInput(HPS::UTF8 const & in_text) { HPS_UNREFERENCED(in_text); return false; }
1193 
1197  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1198 
1200  virtual void OnViewAttached() { return; }
1201 
1203  virtual void OnViewDetached() { return; }
1204 
1207  virtual void OnModelAttached() { return; }
1208 
1211  virtual void OnModelDetached() { return; }
1212 
1214  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1215 
1218  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1219 
1223  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1224 
1226  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1227 
1229  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1230 
1231  enum class Priority
1232  {
1233  Low,
1234  Default,
1235  High
1236  };
1237 
1238 protected:
1239 
1240  HPS::MouseButtons mouse_trigger;
1241  HPS::ModifierKeys modifier_trigger;
1242 };
1243 
1244 class SPRK_API OperatorUtility
1245 {
1246  static double internal_acos(double x)
1247  {
1248  return (((x)<-1) ? (HPS::PI) : (((x)>1) ? (0) : (acos(x))));
1249  }
1250 
1251 public:
1252 
1253  enum ProjectedPlane
1254  {
1255  Plane_XY,
1256  Plane_YZ,
1257  Plane_XZ
1258  };
1259 
1260  static void ScreenToSphereMousePoint(HPS::Point const &in_pt, HPS::Vector &out_vec)
1261  {
1262  out_vec = HPS::Vector(in_pt);
1263  float len = static_cast<float>(out_vec.Length());
1264  if (len > 1.0f)
1265  {
1266  out_vec /= len;
1267  out_vec.z = 0;
1268  }
1269  else
1270  out_vec.z = (float)sqrt(1.0f - (len*len));
1271  }
1272 
1273  static float CalculateAngleOrbitOnPlane(HPS::Vector const &axis, ProjectedPlane plane)
1274  {
1275  float theta;
1276 
1277  HPS::Vector vtmp;
1278  if (plane == Plane_XY)
1279  vtmp = HPS::Vector(axis.x, axis.y, 0);
1280  else if (plane == Plane_YZ)
1281  vtmp = HPS::Vector(0, axis.y, axis.z);
1282  else
1283  vtmp = HPS::Vector(axis.x, 0, axis.z);
1284  Vector naxis = axis;
1285 
1286  naxis.Normalize();
1287  vtmp.Normalize();
1288 
1289  float tmp = naxis.Dot(vtmp);
1290  if (static_cast<float>(Abs(tmp)) > 1.001f || static_cast<float>(Abs(tmp)) < 0.999f)
1291  theta = static_cast<float>(internal_acos(tmp));
1292  else
1293  theta = 0.0f;
1294 
1295  return theta;
1296  }
1297 };
1298 
1301 class SPRK_API OperatorControl : public SprocketControl
1302 {
1303 public:
1305  explicit OperatorControl(View const & in_view);
1306 
1308  OperatorControl(OperatorControl const & in_that);
1309 
1313  OperatorControl(OperatorControl && in_that);
1314 
1318  OperatorControl & operator=(OperatorControl && in_that);
1319 
1321  ~OperatorControl();
1322 
1323  static const HPS::Type staticType = HPS::Type::OperatorControl;
1324  HPS::Type ObjectType() const {return staticType;};
1325 
1327  OperatorControl & operator=(OperatorControl const & in_that);
1328 
1329 
1331  size_t GetCount();
1332 
1335  size_t GetCount(Operator::Priority in_priority);
1336 
1337 
1343  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1344 
1351  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1352 
1356  bool Pop(Operator::Priority in_priority = Operator::Priority::Default);
1357 
1362  bool Pop(OperatorPtr & out_operator);
1363 
1369  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1370 
1371 
1377  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1378 
1385  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1386 
1392  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Default);
1393 
1400  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Default);
1401 
1402 
1406  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Default);
1407 
1411  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1412 
1415  OperatorControl & UnsetEverything();
1416 
1417 
1421  bool ShowTop(OperatorPtr & out_operator) const;
1422 
1427  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1428 
1432  bool Show(OperatorPtrArray & out_operators) const;
1433 
1438  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1439 
1440 private:
1442  OperatorControl() {}
1443 };
1444 
1451 {
1452 public:
1453 
1454  enum class Location
1455  {
1456  TopRight,
1457  TopLeft,
1458  BottomRight,
1459  BottomLeft,
1460  Custom,
1461  };
1462 
1464  explicit NavigationCubeControl(View const & in_view);
1465 
1468 
1473 
1477  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1478 
1481 
1482  static const HPS::Type staticType = HPS::Type::NavigationCubeControl;
1483  HPS::Type ObjectType() const {return staticType;};
1484 
1486  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1487 
1496  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1497 
1500  Location GetLocation() const;
1501 
1505  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1506 
1509  HPS::Rectangle GetPosition() const;
1510 
1514  NavigationCubeControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1515 
1518  HPS::IntRectangle GetPositionOffsets() const;
1519 
1524  NavigationCubeControl & SetVisibility(bool in_visibility);
1525 
1528  bool GetVisibility() const;
1529 
1533  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1534 
1537  bool GetTextVisibility() const;
1538 
1553  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1554 
1557  HPS::UTF8 GetMaterialPalette() const;
1558 
1566  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1567 
1568 
1571  bool GetInteractivity() const;
1572 
1577  NavigationCubeControl & SetSize(float in_size);
1578 
1581  float GetSize() const;
1582 
1585  HPS::SegmentKey GetSegmentKey() const;
1586 
1587 private:
1589  NavigationCubeControl() {}
1590 
1592  HPS::SegmentKey GetNavigationCubeSegment() const;
1593 };
1594 
1597 class SPRK_API AxisTriadControl : public SprocketControl
1598 {
1599 public:
1600 
1601  enum class Location
1602  {
1603  TopRight,
1604  TopLeft,
1605  BottomRight,
1606  BottomLeft,
1607  Custom,
1608  };
1609 
1611  explicit AxisTriadControl(View const & in_view);
1612 
1614  AxisTriadControl(AxisTriadControl const & in_that);
1615 
1619  AxisTriadControl(AxisTriadControl && in_that);
1620 
1624  AxisTriadControl & operator=(AxisTriadControl && in_that);
1625 
1627  ~AxisTriadControl();
1628 
1629  static const HPS::Type staticType = HPS::Type::AxisTriadControl;
1630  HPS::Type ObjectType() const {return staticType;};
1631 
1633  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1634 
1643  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_position = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1644 
1647  Location GetLocation() const;
1648 
1652  AxisTriadControl & SetPosition(HPS::Rectangle const & in_position);
1653 
1656  HPS::Rectangle GetPosition() const;
1657 
1661  AxisTriadControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1662 
1665  HPS::IntRectangle GetPositionOffsets() const;
1666 
1671  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1672 
1675  bool GetVisibility() const;
1676 
1680  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1681 
1684  bool GetTextVisibility() const;
1685 
1694  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1695 
1698  HPS::UTF8 GetMaterialPalette() const;
1699 
1706  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1707 
1710  bool GetInteractivity() const;
1711 
1716  AxisTriadControl & SetSize(float in_size);
1717 
1720  float GetSize() const;
1721 
1724  HPS::SegmentKey GetSegmentKey() const;
1725 
1726 private:
1728  AxisTriadControl(){};
1729 
1731  HPS::SegmentKey GetAxisTriadSegment() const;
1732 };
1733 
1735 class SPRK_API Component : public Sprocket
1736 {
1737 public:
1738 
1741  enum class Visibility : uint32_t
1742  {
1743  PreserveUserDefined,
1744  PreserveModelDefined,
1745  PreserveNone,
1746  PreserveAll,
1747  };
1748 
1751  enum class ComponentType : uint32_t
1752  {
1753  None = 0x00000000,
1754  GenericMask = 0xfffff000,
1755 
1756  ExchangeComponentMask = 0x00001000,
1757  ExchangeModelFile = 0x00001001,
1758  ExchangeProductOccurrence = 0x00001002,
1759  ExchangePartDefinition = 0x00001003,
1760 
1761  ExchangeView = 0x00001004,
1762  ExchangeFilter = 0x00001005,
1763 
1764  ExchangeRepresentationItemMask = 0x00003000,
1765  ExchangeRIBRepModel = 0x00003001,
1766  ExchangeRICurve = 0x00003002,
1767  ExchangeRIDirection = 0x00003003,
1768  ExchangeRIPlane = 0x00003004,
1769  ExchangeRIPointSet = 0x00003005,
1770  ExchangeRIPolyBRepModel = 0x00003006,
1771  ExchangeRIPolyWire = 0x00003007,
1772  ExchangeRISet = 0x00003008,
1773  ExchangeRICoordinateSystem = 0x00003009,
1774 
1775  ExchangeTopologyMask = 0x00005000,
1776  ExchangeTopoBody = 0x00005001,
1777  ExchangeTopoConnex = 0x00005002,
1778  ExchangeTopoShell = 0x00005003,
1779  ExchangeTopoFace = 0x00005004,
1780  ExchangeTopoLoop = 0x00005005,
1781  ExchangeTopoCoEdge = 0x00005006,
1782  ExchangeTopoEdge = 0x00005007,
1783  ExchangeTopoVertex = 0x00005008,
1784  ExchangeTopoSingleWireBody = 0x00005009,
1785  ExchangeTopoWireEdge = 0x0000500a,
1786 
1787  ExchangeDrawingMask = 0x00009000,
1788  ExchangeDrawingModel = 0x00009001,
1789  ExchangeDrawingView = 0x00009002,
1790  ExchangeDrawingSheet = 0x00009003,
1791  ExchangeBasicDrawingBlock = 0x00009004,
1792  ExchangeOperatorDrawingBlock = 0x00009005,
1793 
1794  ExchangePMIMask = 0x00011000,
1795  ExchangePMI = ExchangePMIMask,
1796  ExchangePMIText = 0x00011100,
1797  ExchangePMIRichText = 0x00011200,
1798  ExchangePMIRoughness = 0x00011300,
1799  ExchangePMIGDT = 0x00011400,
1800  ExchangePMIDatum = 0x00011500,
1801  ExchangePMILineWelding = 0x00011600,
1802  ExchangePMISpotWelding = 0x00011700,
1803  ExchangePMIDimension = 0x00011800,
1804  ExchangePMIBalloon = 0x00011900,
1805  ExchangePMICoordinate = 0x00011a00,
1806  ExchangePMIFastener = 0x00011b00,
1807  ExchangePMILocator = 0x00011c00,
1808  ExchangePMIMeasurementPoint = 0x00011d00,
1809 
1810 
1811  ParasolidComponentMask = 0x00020000,
1812 
1813  ParasolidModelFile = 0x00020001,
1814  ParasolidAssembly = 0x00020002,
1815  ParasolidInstance = 0x00020003,
1816 
1817  ParasolidTopologyMask = 0x00060000,
1818  ParasolidTopoBody = 0x00060001,
1819  ParasolidTopoRegion = 0x00060002,
1820  ParasolidTopoShell = 0x00060003,
1821  ParasolidTopoFace = 0x00060004,
1822  ParasolidTopoLoop = 0x00060005,
1823  ParasolidTopoFin = 0x00060006,
1824  ParasolidTopoEdge = 0x00060007,
1825  ParasolidTopoVertex = 0x00060008,
1826 
1827 
1828  DWGComponentMask = 0x00100000,
1829  DWGModelFile = 0x00100001,
1830  DWGLayout = 0x00100002,
1831  DWGBlockTable = 0x00100003,
1832  DWGBlockTableRecord = 0x00100004,
1833  DWGEntity = 0x00100005,
1834  DWGLayerTable = 0x00100006,
1835  DWGLayer = 0x00100007,
1836 
1837 
1838  UserComponent = 0x01000000,
1839  };
1840 
1841 
1843  Component();
1844 
1847  Component(Component const & in_that);
1848 
1851  Component(Component && in_that);
1852 
1854  virtual ~Component();
1855 
1856  static const HPS::Type staticType = HPS::Type::Component;
1857  HPS::Type ObjectType() const { return staticType; }
1858 
1859 
1863  Component & operator=(Component const & in_that);
1864 
1868  Component & operator=(Component && in_that);
1869 
1873  virtual void Assign(Component const & in_that);
1874 
1878  bool Equals(Component const & in_that) const;
1879 
1883  bool operator!=(Component const & in_that) const;
1884 
1888  bool operator==(Component const & in_that) const;
1889 
1890 
1893  ComponentType GetComponentType() const;
1894 
1898  bool HasComponentType(ComponentType in_mask) const;
1899 
1900 
1901 
1907  void AddKey(Key const & in_key);
1908 
1911  KeyArray GetKeys() const;
1912 
1913 
1914 
1919  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1920 
1924  ComponentArray GetOwners() const;
1925 
1928  ComponentArray GetSubcomponents() const;
1929 
1934  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1935 
1936 
1937 
1940  void AddReference(Component & in_reference);
1941 
1944  ComponentArray GetReferrers() const;
1945 
1949  ComponentArray GetReferences() const;
1950 
1951 
1952 
1955  MetadataArray GetAllMetadata() const;
1956 
1960  Metadata GetMetadata(char const * in_name) const;
1961 
1965  UTF8 GetName() const;
1966 
1967 
1968 
2021  void Delete();
2022 
2026  void Flush();
2027 
2028 
2036  static KeyPathArray GetKeyPath(Component const & in_component);
2037 
2047  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
2048 
2057  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
2058 };
2059 
2061 class SPRK_API ComponentPath : public Sprocket
2062 {
2063 public:
2065  ComponentPath();
2066 
2069  ComponentPath(ComponentArray const & in_components);
2070 
2074  ComponentPath(size_t in_count, Component const in_components[]);
2075 
2077  ComponentPath(ComponentPath const & in_that);
2078 
2082  ComponentPath(ComponentPath && in_that);
2083 
2087  ComponentPath & operator=(ComponentPath && in_that);
2088 
2090  virtual ~ComponentPath();
2091 
2092  static const HPS::Type staticType = HPS::Type::ComponentPath;
2093  HPS::Type ObjectType() const { return staticType; }
2094 
2097  bool Empty() const;
2098 
2102  ComponentPath & operator+=(Component const & in_component);
2103 
2107  ComponentPath & operator+=(ComponentPath const & in_path);
2108 
2112  ComponentPath & operator+=(ComponentArray const & in_components);
2113 
2117  ComponentPath & Append(Component const & in_component);
2118 
2122  ComponentPath & Append(ComponentPath const & in_path);
2123 
2127  ComponentPath & Append(ComponentArray const & in_components);
2128 
2132  ComponentPath & operator=(ComponentPath const & in_that);
2133 
2137  ComponentPath & operator=(ComponentArray const & in_path);
2138 
2141  void Set(ComponentPath const & in_that);
2142 
2146  bool Equals(ComponentPath const & in_that) const;
2147 
2151  bool operator!= (ComponentPath const & in_that) const;
2152 
2156  bool operator== (ComponentPath const & in_that) const;
2157 
2158 
2162  ComponentPath & SetComponents(ComponentArray const & in_components);
2163 
2168  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
2169 
2172  ComponentArray GetComponents() const;
2173 
2177  KeyPathArray GetKeyPaths() const;
2178 
2183  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
2184 
2185 
2192  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options, bool in_remove_existing = true) const;
2193 
2200  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options, bool in_remove_existing = true) const;
2201 
2205  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2206 
2211  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2212 
2213 
2218  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2219 
2224  void Show(Canvas const & in_canvas, size_t in_layer = 0, Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
2225 
2231  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
2232 
2239  void Isolate(Canvas const & in_canvas, size_t in_layer = 0, Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
2240 
2248  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0, Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
2249 };
2250 
2251 
2256 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2257 {
2258  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2259 }
2260 
2265 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2266 {
2267  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2268 }
2269 
2274 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2275 {
2276  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2277 }
2278 
2283 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2284 {
2285  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2286 }
2287 
2292 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2293 {
2294  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2295 }
2296 
2301 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2302 {
2303  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2304 }
2305 
2310 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2311 {
2312  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2313 }
2314 
2319 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2320 {
2321  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2322 }
2323 
2328 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2329 {
2330  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2331 }
2332 
2334 class SPRK_API ComponentIsolateEvent : public Event
2335 {
2336 public:
2337 
2340  {
2341  channel = GetClassID();
2342  consumable = false;
2343  subcomponent_visibility = Component::Visibility::PreserveNone;
2344  }
2345 
2346  ComponentIsolateEvent(ComponentPath const & in_path,
2347  Component::Visibility in_subcomponent_visibility)
2348  : Event(), path(in_path), subcomponent_visibility(in_subcomponent_visibility)
2349  {
2350  channel = GetClassID();
2351  consumable = false;
2352  }
2353 
2356  ComponentIsolateEvent(Event const & in_event) : Event(in_event)
2357  {
2358  if (in_event.GetChannel() == Object::ClassID<ComponentIsolateEvent>())
2359  {
2360  auto that = static_cast<ComponentIsolateEvent const &>(in_event);
2361  subcomponent_visibility = that.subcomponent_visibility;
2362  path = that.path;
2363  }
2364  else
2365  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2366  }
2367 
2369 
2372  Event * Clone() const
2373  {
2374  ComponentIsolateEvent * new_event = new ComponentIsolateEvent(*this);
2375  return new_event;
2376  }
2377 
2378  ComponentPath path;
2379  Component::Visibility subcomponent_visibility;
2380 };
2381 
2382 
2384 class SPRK_API ComponentHighlightEvent : public Event
2385 {
2386 public:
2387  enum class Action
2388  {
2389  None = 0,
2390  Highlight,
2391  Unhighlight,
2392  };
2393 
2396  {
2397  channel = GetClassID();
2398  consumable = false;
2399  action = Action::None;
2400  }
2401 
2402  ComponentHighlightEvent(Action in_action,
2403  ComponentPath const & in_path = ComponentPath(),
2404  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2405  : Event(), action(in_action), path(in_path), options(in_options)
2406  {
2407  channel = GetClassID();
2408  consumable = false;
2409  }
2410 
2413  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2414  {
2415  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2416  {
2417  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2418  action = that.action;
2419  path = that.path;
2420  options = that.options;
2421  }
2422  else
2423  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2424  }
2425 
2427 
2430  Event * Clone() const
2431  {
2432  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2433  return new_event;
2434  }
2435 
2436  Action action;
2437  ComponentPath path;
2438  HighlightOptionsKit options;
2439 };
2440 
2441 
2443 class SPRK_API Filter : public Component
2444 {
2445 public:
2447  Filter();
2448 
2452  Filter(Component const & in_that);
2453 
2456  Filter(Filter const & in_that);
2457 
2460  Filter(Filter && in_that);
2461 
2462  virtual ~Filter();
2463 
2464  static const HPS::Type staticType = HPS::Type::Filter;
2465  HPS::Type ObjectType() const { return staticType; }
2466 
2467 
2468 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2469  Filter & operator=(Filter const & in_that) = default;
2470 #endif
2471 
2475  Filter & operator=(Filter && in_that);
2476 
2477 
2480  void Activate(View const & in_view);
2481 
2484  void Deactivate(View const & in_view);
2485 };
2486 
2487 
2488 class SPRK_API FilterActivationEvent : public Event
2489 {
2490 public:
2491  enum class Action
2492  {
2493  None = 0,
2494  Activate,
2495  Deactivate,
2496  };
2497 
2500  {
2501  channel = GetClassID();
2502  consumable = false;
2503  }
2504 
2505  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2506  {
2507  channel = GetClassID();
2508  consumable = false;
2509  }
2510 
2513  FilterActivationEvent(Event const & in_event) : Event(in_event)
2514  {
2515  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2516  {
2517  auto that = static_cast<FilterActivationEvent const &>(in_event);
2518  filter = that.filter;
2519  action = that.action;
2520  view = that.view;
2521  }
2522  else
2523  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2524  }
2525 
2527 
2530  Event * Clone() const
2531  {
2532  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2533  return new_event;
2534  }
2535 
2536  Filter filter;
2537  Action action;
2538  View view;
2539 };
2540 
2541 
2543 class SPRK_API Capture : public Component
2544 {
2545 public:
2547  Capture();
2548 
2552  Capture(Component const & in_that);
2553 
2556  Capture(Capture const & in_that);
2557 
2560  Capture(Capture && in_that);
2561 
2562  virtual ~Capture();
2563 
2564  static const HPS::Type staticType = HPS::Type::Capture;
2565  HPS::Type ObjectType() const { return staticType; }
2566 
2567 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2568  Capture & operator=(Capture const & in_that) = default;
2569 #endif
2570 
2574  Capture & operator=(Capture && in_that);
2575 
2576 
2580  View Activate();
2581 };
2582 
2583 
2584 class SPRK_API CaptureActivationEvent : public Event
2585 {
2586 public:
2589  {
2590  channel = GetClassID();
2591  consumable = false;
2592  }
2593 
2594  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2595  {
2596  channel = GetClassID();
2597  consumable = false;
2598  }
2599 
2602  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2603  {
2604  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2605  {
2606  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2607  capture = that.capture;
2608  view = that.view;
2609  }
2610  else
2611  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2612  }
2613 
2615 
2618  Event * Clone() const
2619  {
2620  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2621  return new_event;
2622  }
2623 
2624  Capture capture;
2625  View view;
2626 };
2627 
2628 
2630 class SPRK_API CADModel : public Component
2631 {
2632 public:
2634  CADModel();
2635 
2639  CADModel(Component const & in_that);
2640 
2643  CADModel(CADModel const & in_that);
2644 
2647  CADModel(CADModel && in_that);
2648 
2651  CADModel(Model const & in_that);
2652 
2653  virtual ~CADModel();
2654 
2655  static const HPS::Type staticType = HPS::Type::CADModel;
2656  HPS::Type ObjectType() const { return staticType; }
2657 
2658 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2659  CADModel & operator=(CADModel const & in_that) = default;
2660 #endif
2661 
2665  CADModel & operator=(CADModel && in_that);
2666 
2667 
2671  Component GetComponentFromKey(Key const & in_key) const;
2672 
2680  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2681 
2690  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2691 
2692 
2695  Model GetModel() const;
2696 
2699  FilterArray GetAllFilters() const;
2700 
2703  CaptureArray GetAllCaptures() const;
2704 
2708  FilterArray GetActiveFilters(View const & in_view) const;
2709 
2710 
2714  View ActivateDefaultCapture();
2715 
2716 
2724  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2725 };
2726 
2727 
2728 
2731 class SPRK_API Metadata : public Sprocket
2732 {
2733 public:
2735  Metadata();
2736 
2739  Metadata(Metadata const & in_that);
2740 
2743  Metadata(Metadata && in_that);
2744 
2747  Metadata(char const * in_name);
2748 
2749  virtual ~Metadata();
2750 
2751  static const HPS::Type staticType = HPS::Type::Metadata;
2752  HPS::Type ObjectType() const { return staticType; }
2753 
2754 
2758  Metadata & operator=(Metadata const & in_that);
2759 
2763  Metadata & operator=(Metadata && in_that);
2764 
2768  virtual void Assign(Metadata const & in_that);
2769 
2773  bool Equals(Metadata const & in_that) const;
2774 
2778  bool operator!=(Metadata const & in_that) const;
2779 
2783  bool operator==(Metadata const & in_that) const;
2784 
2785 
2788  HPS::UTF8 GetName() const;
2789 
2792  void SetName(char const * in_name);
2793 };
2794 
2796 class SPRK_API IntegerMetadata : public Metadata
2797 {
2798 public:
2800  IntegerMetadata();
2801 
2805  IntegerMetadata(Metadata const & in_that);
2806 
2809  IntegerMetadata(IntegerMetadata const & in_that);
2810 
2813  IntegerMetadata(IntegerMetadata && in_that);
2814 
2818  IntegerMetadata(char const * in_name, int in_value);
2819 
2820  virtual ~IntegerMetadata();
2821 
2822  static const HPS::Type staticType = HPS::Type::IntegerMetadata;
2823  HPS::Type ObjectType() const { return staticType; }
2824 
2825 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2826  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2827 #endif
2828 
2832  IntegerMetadata & operator=(IntegerMetadata && in_that);
2833 
2834 
2837  int GetValue() const;
2838 
2841  void SetValue(int in_value);
2842 };
2843 
2845 class SPRK_API UnsignedIntegerMetadata : public Metadata
2846 {
2847 public:
2850 
2854  UnsignedIntegerMetadata(Metadata const & in_that);
2855 
2859 
2863 
2867  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2868 
2869  virtual ~UnsignedIntegerMetadata();
2870 
2871  static const HPS::Type staticType = HPS::Type::UnsignedIntegerMetadata;
2872  HPS::Type ObjectType() const { return staticType; }
2873 
2874 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2875  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2876 #endif
2877 
2881  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2882 
2883 
2886  unsigned int GetValue() const;
2887 
2890  void SetValue(unsigned int in_value);
2891 };
2892 
2894 class SPRK_API DoubleMetadata : public Metadata
2895 {
2896 public:
2898  DoubleMetadata();
2899 
2903  DoubleMetadata(Metadata const & in_that);
2904 
2907  DoubleMetadata(DoubleMetadata const & in_that);
2908 
2911  DoubleMetadata(DoubleMetadata && in_that);
2912 
2916  DoubleMetadata(char const * in_name, double in_value);
2917 
2918  virtual ~DoubleMetadata();
2919 
2920  static const HPS::Type staticType = HPS::Type::DoubleMetadata;
2921  HPS::Type ObjectType() const { return staticType; }
2922 
2923 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2924  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2925 #endif
2926 
2930  DoubleMetadata & operator=(DoubleMetadata && in_that);
2931 
2932 
2935  double GetValue() const;
2936 
2939  void SetValue(double in_value);
2940 };
2941 
2943 class SPRK_API StringMetadata : public Metadata
2944 {
2945 public:
2947  StringMetadata();
2948 
2952  StringMetadata(Metadata const & in_that);
2953 
2956  StringMetadata(StringMetadata const & in_that);
2957 
2960  StringMetadata(StringMetadata && in_that);
2961 
2965  StringMetadata(char const * in_name, char const * in_value);
2966 
2967  virtual ~StringMetadata();
2968 
2969  static const HPS::Type staticType = HPS::Type::StringMetadata;
2970  HPS::Type ObjectType() const { return staticType; }
2971 
2972 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2973  StringMetadata & operator=(StringMetadata const & in_that) = default;
2974 #endif
2975 
2979  StringMetadata & operator=(StringMetadata && in_that);
2980 
2981 
2984  UTF8 GetValue() const;
2985 
2988  void SetValue(char const * in_value);
2989 };
2990 
2992 class SPRK_API TimeMetadata : public Metadata
2993 {
2994 public:
2996  TimeMetadata();
2997 
3001  TimeMetadata(Metadata const & in_that);
3002 
3005  TimeMetadata(TimeMetadata const & in_that);
3006 
3009  TimeMetadata(TimeMetadata && in_that);
3010 
3014  TimeMetadata(char const * in_name, unsigned int in_value);
3015 
3016  virtual ~TimeMetadata();
3017 
3018  static const HPS::Type staticType = HPS::Type::TimeMetadata;
3019  HPS::Type ObjectType() const { return staticType; }
3020 
3021 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3022  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
3023 #endif
3024 
3028  TimeMetadata & operator=(TimeMetadata && in_that);
3029 
3030 
3033  unsigned int GetValue() const;
3034 
3037  HPS::UTF8 GetValueAsString() const;
3038 
3041  void SetValue(unsigned int in_value);
3042 };
3043 
3044 
3046 class SPRK_API BooleanMetadata : public Metadata
3047 {
3048 public:
3050  BooleanMetadata();
3051 
3055  BooleanMetadata(Metadata const & in_that);
3056 
3059  BooleanMetadata(BooleanMetadata const & in_that);
3060 
3063  BooleanMetadata(BooleanMetadata && in_that);
3064 
3068  BooleanMetadata(char const * in_name, bool in_value);
3069 
3070  virtual ~BooleanMetadata();
3071 
3072  static const HPS::Type staticType = HPS::Type::BooleanMetadata;
3073  HPS::Type ObjectType() const { return staticType; }
3074 
3075 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3076  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
3077 #endif
3078 
3082  BooleanMetadata & operator=(BooleanMetadata && in_that);
3083 
3084 
3087  bool GetValue() const;
3088 
3091  void SetValue(bool in_value);
3092 };
3093 
3094 
3095 
3097 class SPRK_API Factory : public Sprocket
3098 {
3099 public:
3100 
3103  static CanvasArray GetCanvases();
3104 
3107  static LayoutArray GetLayouts();
3108 
3111  static ViewArray GetViews();
3112 
3115  static ModelArray GetModels();
3116 
3119  static CADModelArray GetCADModels();
3120 
3126  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
3127 
3132  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
3133 
3139  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
3140 
3144  static Layout CreateLayout(char const * in_name = "");
3145 
3149  static View CreateView(char const * in_name = "");
3150 
3154  static Model CreateModel(char const * in_name = "");
3155 
3156  static Component CreateComponent(HPS::Component const & in_owner, char const * in_name = "");
3157 
3158 private:
3159  Factory() {}
3160 };
3161 
3171 class SPRK_API AxisTriadOperator : public Operator
3172 {
3173 public:
3174  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3176  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
3177 
3183  virtual bool OnMouseDown(MouseState const & in_state);
3188  virtual bool OnMouseUp(MouseState const & in_state);
3193  virtual bool OnMouseMove(MouseState const & in_state);
3194 
3199  virtual bool OnTouchDown(TouchState const & in_state);
3204  virtual bool OnTouchUp(TouchState const & in_state);
3209  virtual bool OnTouchMove(TouchState const & in_state);
3210 
3211  virtual void OnViewAttached();
3212 
3213 private:
3214 
3215  bool AxisOrbit(HPS::WindowPoint const & in_loc);
3216  void Transition(HPS::SelectionResults selection_results);
3217  void TranslatePoint(HPS::WindowPoint * point);
3218  bool IsEventRelevant(HPS::Point const & event_location);
3219 
3220  bool operator_active;
3221  HPS::WindowPoint start_point;
3222  HPS::Vector start_sphere_point;
3223  float axis_subwindow_width;
3224  float axis_subwindow_height;
3225  HPS::TouchID tracked_touch_ID;
3226  HPS::Rectangle axis_subwindow;
3227  HPS::IntRectangle axis_subwindow_offsets;
3228  HPS::SegmentKey axis_triad_segment;
3229 
3230 };
3231 
3234 {
3235 public:
3238  virtual ~SmoothTransitionCompleteEvent();
3239 
3242  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
3243  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
3244 
3247  SmoothTransitionCompleteEvent(Event const & in_event) : Event(in_event)
3248  {
3249  if (in_event.GetChannel() == Object::ClassID<SmoothTransitionCompleteEvent>())
3250  {
3251  auto that = static_cast<SmoothTransitionCompleteEvent const &>(in_event);
3252  view = that.view;
3253  }
3254  else
3255  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3256  }
3257 
3260  Event * Clone() const
3261  {
3263  return new_event;
3264  }
3265 
3269  virtual bool Drop(Event const * in_that_event) const
3270  {
3271  HPS_UNREFERENCED(in_that_event);
3272  return false;
3273  }
3274 
3275  HPS::View view;
3276 };
3277 
3296 class SPRK_API NavigationCubeOperator : public Operator
3297 {
3298 public:
3299  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3300  ~NavigationCubeOperator() { }
3301 
3303  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3304 
3309  virtual bool OnMouseDown(MouseState const & in_state);
3314  virtual bool OnMouseUp(MouseState const & in_state);
3319  virtual bool OnMouseMove(MouseState const & in_state);
3320 
3324  virtual bool OnTouchDown(TouchState const & in_state);
3329  virtual bool OnTouchUp(TouchState const & in_state);
3334  virtual bool OnTouchMove(TouchState const & in_state);
3335 
3336  virtual void OnViewAttached();
3337  virtual void OnViewDetached();
3338 
3339  virtual void OnModelAttached();
3340 
3341  void UpdateHighlightColor();
3342 
3347  void SetReferenceSegment(HPS::KeyPath const & in_path_to_segment);
3348 
3353  void SetReferenceSegment(HPS::KeyPathArray const & in_path_to_segments);
3354 
3358  HPS::KeyPathArray ShowReferenceSegment();
3359 
3360 private:
3361  void Transition(HPS::SelectionResults const & selection_results);
3362  bool Orbit(HPS::WindowPoint const & in_loc);
3363  void TranslatePoint(HPS::WindowPoint * point);
3364  bool IsEventRelevant(HPS::Point const & event_location, HPS::KeyPath const & event_path);
3365  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3366 
3367  bool operator_active;
3368  HPS::TouchID tracked_touch_ID;
3369  HPS::WindowPoint start_point;
3370  HPS::WindowPoint down_position;
3371  HPS::Vector start_sphere_point;
3372  HPS::KeyPathArray reference_segments; //rotation and zooming happen around these segments
3373 
3374  HPS::SegmentKey nav_cube_segment;
3375  HPS::SegmentKey style_segment;
3376  HPS::PortfolioKey portfolio;
3377  HPS::ReferenceKeyArrayArray groups;
3378  HPS::HighlightOptionsKit highlight_options_kit;
3379  HPS::CameraKit previous_camera;
3380  int previous_face;
3381  bool suppress_mouse_over_highlights;
3382 
3383  HPS::Rectangle nav_cube_subwindow;
3384  HPS::IntRectangle nav_cube_subwindow_offsets;
3385  float nav_cube_subwindow_width;
3386  float nav_cube_subwindow_height;
3387 
3388  int highlighted_group;
3389 
3390  bool moving;
3391 
3392  class SmoothTransitionCompleteEventHandler : public EventHandler
3393  {
3394  public:
3395  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3396  : handler_view(in_view), handler_moving(&in_moving) {}
3397 
3398  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3399 
3400  virtual HandleResult Handle(HPS::Event const * in_event);
3401 
3402  private:
3403  View handler_view;
3404  bool * handler_moving;
3405  };
3406 
3407  SmoothTransitionCompleteEventHandler * handler;
3408 };
3409 
3410 
3411 
3412 
3413 class SceneTreeItem;
3414 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3415 class SceneTree;
3416 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3417 
3420 class SPRK_API SceneTree : public Sprocket
3421 {
3422 public:
3425  enum class ItemType : uint32_t
3426  {
3427  None = 0x00000000,
3428  GenericMask = 0xffff0000,
3429 
3430  Segment = 0x00000001,
3431  Include = 0x00000002,
3432  ConditionalExpression = 0x00000003,
3433  StaticModelSegment = 0x00000004,
3434  AttributeFilter = 0x00000005,
3435 
3436  Geometry = 0x00010000,
3437  CuttingSection = 0x00010001,
3438  Shell = 0x00010002,
3439  Mesh = 0x00010003,
3440  Grid = 0x00010004,
3441  NURBSSurface = 0x00010005,
3442  Cylinder = 0x00010006,
3443  Sphere = 0x00010007,
3444  Polygon = 0x00010008,
3445  Circle = 0x00010009,
3446  CircularWedge = 0x0001000a,
3447  Ellipse = 0x0001000b,
3448  Line = 0x0001000c,
3449  NURBSCurve = 0x0001000d,
3450  CircularArc = 0x0001000e,
3451  EllipticalArc = 0x0001000f,
3452  InfiniteLine = 0x00010010,
3453  InfiniteRay = 0x00010011,
3454  Marker = 0x00010012,
3455  Text = 0x00010013,
3456  Reference = 0x00010014,
3457  DistantLight = 0x00010015,
3458  Spotlight = 0x00010016,
3459 
3460  Attribute = 0x00020000,
3461  Portfolio = 0x00020001,
3462  SegmentStyle = 0x00020002,
3463  NamedStyle = 0x00020003,
3464  MaterialPalette = 0x00020004,
3465  Priority = 0x00020005,
3466  Material = 0x00020006,
3467  Camera = 0x00020007,
3468  ModellingMatrix = 0x00020008,
3469  UserData = 0x00020009,
3470  TextureMatrix = 0x0002000a,
3471  Culling = 0x0002000b,
3472  CurveAttribute = 0x0002000c,
3473  CylinderAttribute = 0x0002000d,
3474  EdgeAttribute = 0x0002000e,
3475  LightingAttribute = 0x0002000f,
3476  LineAttribute = 0x00020010,
3477  MarkerAttribute = 0x00020011,
3478  SurfaceAttribute = 0x00020012,
3479  Selectability = 0x00020013,
3480  SphereAttribute = 0x00020014,
3481  Subwindow = 0x00020015,
3482  TextAttribute = 0x00020016,
3483  Transparency = 0x00020017,
3484  Visibility = 0x00020018,
3485  VisualEffects = 0x00020019,
3486  Performance = 0x00020020,
3487  DrawingAttribute = 0x00020021,
3488  HiddenLineAttribute = 0x00020022,
3489  ContourLine = 0x00020023,
3490  Condition = 0x00020024,
3491  Bounding = 0x00020025,
3492  AttributeLock = 0x00020026,
3493  TransformMask = 0x00020027,
3494  ColorInterpolation = 0x00020028,
3495  CuttingSectionAttribute = 0x00020029,
3496 
3497  // window only attributes
3498  Debugging = 0x00020030,
3499  PostProcessEffects = 0x00020031,
3500  SelectionOptions = 0x00020032,
3501  UpdateOptions = 0x00020033,
3502 
3503  Definition = 0x00040000,
3504  NamedStyleDefinition = 0x00040001,
3505  TextureDefinition = 0x00040002,
3506  LinePatternDefinition = 0x00040003,
3507  GlyphDefinition = 0x00040004,
3508  CubeMapDefinition = 0x00040005,
3509  ImageDefinition = 0x00040006,
3510  MaterialPaletteDefinition = 0x00040007,
3511  ShaderDefinition = 0x00040008,
3512  ShapeDefinition = 0x00040009,
3513 
3514  Group = 0x00080000,
3515  SegmentGroup = 0x00080100,
3516  GeometryGroup = 0x00080200,
3517  AttributeGroup = 0x00080300,
3518  PortfolioGroup = 0x00080400,
3519  StyleGroup = 0x00080500,
3520  IncludeGroup = 0x00080600,
3521  DefinitionGroup = 0x00180000,
3522  NamedStyleDefinitionGroup = 0x00180700,
3523  TextureDefinitionGroup = 0x00180800,
3524  LinePatternDefinitionGroup = 0x00180900,
3525  GlyphDefinitionGroup = 0x00180a00,
3526  CubeMapDefinitionGroup = 0x00180b00,
3527  ImageDefinitionGroup = 0x00180c00,
3528  MaterialPaletteDefinitionGroup = 0x00180d00,
3529  ShaderDefinitionGroup = 0x00180e00,
3530  ShapeDefinitionGroup = 0x00180f00,
3531  CuttingSectionGroup = 0x00080001,
3532  ShellGroup = 0x00080002,
3533  MeshGroup = 0x00080003,
3534  GridGroup = 0x00080004,
3535  NURBSSurfaceGroup = 0x00080005,
3536  CylinderGroup = 0x00080006,
3537  SphereGroup = 0x00080007,
3538  PolygonGroup = 0x00080008,
3539  CircleGroup = 0x00080009,
3540  CircularWedgeGroup = 0x0008000a,
3541  EllipseGroup = 0x0008000b,
3542  LineGroup = 0x0008000c,
3543  NURBSCurveGroup = 0x0008000d,
3544  CircularArcGroup = 0x0008000e,
3545  EllipticalArcGroup = 0x0008000f,
3546  InfiniteLineGroup = 0x00080010,
3547  InfiniteRayGroup = 0x00080011,
3548  MarkerGroup = 0x00080012,
3549  TextGroup = 0x00080013,
3550  ReferenceGroup = 0x00080014,
3551  DistantLightGroup = 0x00080015,
3552  SpotlightGroup = 0x00080016,
3553  };
3554 
3556  SceneTree();
3557 
3560  SceneTree(Canvas const & in_canvas);
3561 
3564  SceneTree(SceneTree const & in_that);
3565 
3568  SceneTree(SceneTree && in_that);
3569 
3570  virtual ~SceneTree();
3571 
3572  static const HPS::Type staticType = HPS::Type::SceneTree;
3573  virtual HPS::Type ObjectType() const { return staticType; }
3574 
3578  SceneTree & operator=(SceneTree const & in_that);
3579 
3583  SceneTree & operator=(SceneTree && in_that);
3584 
3588  virtual void Assign(SceneTree const & in_that);
3589 
3593  bool Equals(SceneTree const & in_that) const;
3594 
3598  bool operator!=(SceneTree const & in_that) const;
3599 
3603  bool operator==(SceneTree const & in_that) const;
3604 
3605 
3614  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3615 
3625  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3626 
3637  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3638 
3646  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3647 
3650  HighlightOptionsKitArray GetHighlightOptions() const;
3651 
3652 
3657  void SetGroupingLimit(size_t in_limit);
3658 
3661  size_t GetGroupingLimit() const;
3662 
3663 
3670  void SetRoot(SceneTreeItemPtr const & in_root);
3671 
3674  SceneTreeItemPtr GetRoot() const;
3675 
3676 
3679  virtual void Flush();
3680 
3685  void SetHighlightEventHandling(bool in_state);
3686 
3690  bool GetHighlightEventHandling() const;
3691 
3694  void ReExpand();
3695 };
3696 
3697 
3700 class SPRK_API SceneTreeItem : public Sprocket
3701 {
3702 public:
3704  SceneTreeItem();
3705 
3708  SceneTreeItem(SceneTreeItem const & in_that);
3709 
3712  SceneTreeItem(SceneTreeItem && in_that);
3713 
3719  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3720 
3726  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3727 
3733  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3734 
3740  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3741 
3749  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3750 
3751  virtual ~SceneTreeItem();
3752 
3753  static const HPS::Type staticType = HPS::Type::SceneTreeItem;
3754  HPS::Type ObjectType() const { return staticType; }
3755 
3759  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3760 
3764  SceneTreeItem & operator=(SceneTreeItem && in_that);
3765 
3769  virtual void Assign(SceneTreeItem const & in_that);
3770 
3774  bool Equals(SceneTreeItem const & in_that) const;
3775 
3779  bool operator!=(SceneTreeItem const & in_that) const;
3780 
3784  bool operator==(SceneTreeItem const & in_that) const;
3785 
3786 
3789  SceneTreePtr GetTree() const;
3790 
3793  UTF8 GetTitle() const;
3794 
3797  SceneTree::ItemType GetItemType() const;
3798 
3802  bool HasItemType(SceneTree::ItemType in_mask) const;
3803 
3806  Key GetKey() const;
3807 
3810  KeyPath GetKeyPath() const;
3811 
3814  bool HasChildren() const;
3815 
3816 
3825  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3826 
3827 
3830  virtual void Expand();
3831 
3834  virtual void Collapse();
3835 
3836 
3841  bool IsSelected() const;
3842 
3848  virtual void Select();
3849 
3855  virtual void Unselect();
3856 
3861  bool IsHighlightable() const;
3862 
3868  bool IsHighlighted() const;
3869 
3874  void Highlight(size_t in_highlight_options_index = 0);
3875 
3881  void Highlight(HighlightOptionsKit const & in_highlight_options);
3882 
3888  void Unhighlight(size_t in_highlight_options_index = 0);
3889 
3896  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3897 
3900  bool IsExpanded() const;
3901 
3904  void ReExpand();
3905 };
3906 
3907 
3908 
3909 class ComponentTreeItem;
3910 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3911 class ComponentTree;
3912 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3913 
3916 class SPRK_API ComponentTree : public Sprocket
3917 {
3918 public:
3921  enum class ItemType
3922  {
3923  None,
3924  ExchangeComponent,
3925  ExchangeModelFile,
3926 
3927  ExchangeViewGroup,
3928  ExchangeAnnotationViewGroup,
3929  ExchangePMIGroup,
3930  ExchangeModelGroup,
3931 
3932  ParasolidComponent,
3933  ParasolidModelFile,
3934 
3935  DWGComponent,
3936  DWGModelFile,
3937  };
3938 
3940  ComponentTree();
3941 
3945  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3946 
3949  ComponentTree(ComponentTree const & in_that);
3950 
3953  ComponentTree(ComponentTree && in_that);
3954 
3955  virtual ~ComponentTree();
3956 
3957  static const HPS::Type staticType = HPS::Type::ComponentTree;
3958  virtual HPS::Type ObjectType() const { return staticType; }
3959 
3963  ComponentTree & operator=(ComponentTree const & in_that);
3964 
3968  ComponentTree & operator=(ComponentTree && in_that);
3969 
3973  virtual void Assign(ComponentTree const & in_that);
3974 
3978  bool Equals(ComponentTree const & in_that) const;
3979 
3983  bool operator!=(ComponentTree const & in_that) const;
3984 
3988  bool operator==(ComponentTree const & in_that) const;
3989 
3990 
3999  void SetHighlightOptions(HighlightOptionsKit const & in_options);
4000 
4010  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
4011 
4022  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
4023 
4033  void AddHighlightOptions(HighlightOptionsKit const & in_options);
4034 
4037  HighlightOptionsKitArray GetHighlightOptions() const;
4038 
4039 
4046  void SetRoot(ComponentTreeItemPtr const & in_root);
4047 
4050  ComponentTreeItemPtr GetRoot() const;
4051 
4052 
4055  virtual void Flush();
4056 
4059  void ReExpand();
4060 
4065  void SetHighlightEventHandling(bool in_state);
4066 
4070  bool GetHighlightEventHandling() const;
4071 };
4072 
4073 
4076 class SPRK_API ComponentTreeItem : public Sprocket
4077 {
4078 public:
4081 
4084  ComponentTreeItem(ComponentTreeItem const & in_that);
4085 
4089 
4095  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
4096 
4103  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
4104 
4105  virtual ~ComponentTreeItem();
4106 
4107  static const HPS::Type staticType = HPS::Type::ComponentTreeItem;
4108  HPS::Type ObjectType() const { return staticType; }
4109 
4113  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
4114 
4118  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
4119 
4123  virtual void Assign(ComponentTreeItem const & in_that);
4124 
4128  bool Equals(ComponentTreeItem const & in_that) const;
4129 
4133  bool operator!=(ComponentTreeItem const & in_that) const;
4134 
4138  bool operator==(ComponentTreeItem const & in_that) const;
4139 
4140 
4141 
4144  ComponentTreePtr GetTree() const;
4145 
4148  UTF8 GetTitle() const;
4149 
4152  ComponentTree::ItemType GetItemType() const;
4153 
4156  Component GetComponent() const;
4157 
4160  bool HasChildren() const;
4161 
4164  ComponentPath GetPath() const;
4165 
4166 
4174  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
4175 
4176 
4179  virtual void Expand();
4180 
4183  virtual void Collapse();
4184 
4185 
4193  bool IsHighlighted() const;
4194 
4199  virtual void OnHighlight(HighlightOptionsKit const & in_options);
4200 
4205  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
4206 
4207 
4212  void Highlight(size_t in_highlight_options_index = 0);
4213 
4219  void Highlight(HighlightOptionsKit const & in_highlight_options);
4220 
4225  void Unhighlight(size_t in_highlight_options_index = 0);
4226 
4232  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
4233 
4234 
4246  bool IsHidden() const;
4247 
4251  virtual void OnHide();
4252 
4256  virtual void OnShow();
4257 
4262  void Hide();
4263 
4269  void Show(Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
4270 
4276  void Isolate(Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
4277 
4280  bool IsExpanded() const;
4281 
4284  void ReExpand();
4285 };
4286 
4287 
4288 
4289 
4290 }
4291 #endif
4292 
4293 
4294 
Definition: sprk.h:2992
Definition: hps.h:3383
Definition: hps.h:6201
Definition: sprk.h:998
Event * Clone() const
Definition: sprk.h:751
Definition: sprk.h:3171
Definition: sprk.h:267
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2413
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1197
Definition: hps.h:42217
ComponentHighlightEvent()
Definition: sprk.h:2395
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1223
Definition: hps.h:470
CameraChangedEvent(Event const &in_event)
Definition: sprk.h:1017
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1182
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5816
Location
Definition: sprk.h:1454
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1226
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1187
ItemType
Definition: sprk.h:3921
Definition: hps.h:5856
virtual intptr_t Freshen() const
Definition: sprk.h:1040
CaptureActivationEvent()
Definition: sprk.h:2588
Definition: sprk.h:66
Definition: sprk.h:208
ComponentIsolateEvent(Event const &in_event)
Definition: sprk.h:2356
Definition: sprk.h:673
Definition: sprk.h:100
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1147
Definition: sprk.h:4076
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1157
Definition: sprk.h:3046
Definition: hps.h:42000
ComponentIsolateEvent()
Definition: sprk.h:2339
Definition: hps.h:1337
Definition: hps.h:1055
Definition: hps.h:1725
Visibility
Definition: sprk.h:1741
Definition: sprk.h:236
ModelDeletedEvent()
Definition: sprk.h:959
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:3242
std::vector< KeyPath, Allocator< KeyPath > > KeyPathArray
Array of type HPS::KeyPath.
Definition: hps.h:6667
Definition: sprk.h:3916
Definition: hps.h:47549
Definition: sprk.h:1058
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1172
Definition: hps.h:7707
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1218
Definition: hps.h:3534
Definition: hps.h:2091
Definition: sprk.h:910
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:795
Definition: sprk.h:2334
Definition: sprk.h:761
Definition: hps.h:1420
Definition: hps.h:876
Definition: hps.h:42120
virtual void OnModelDetached()
Definition: sprk.h:1211
SmoothTransitionCompleteEvent(Event const &in_event)
Definition: sprk.h:3247
Definition: hps.h:1783
Definition: hps.h:1549
Definition: hps.h:8934
Definition: hps.h:244
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1214
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1843
Event * Clone() const
Definition: sprk.h:901
CameraChangedEvent()
Definition: sprk.h:1002
SprocketKit & operator=(SprocketKit &&in_that)
Definition: sprk.h:257
Definition: hps.h:47447
Definition: hps.h:41053
Definition: sprk.h:1450
Definition: sprk.h:955
Definition: sprk.h:557
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:837
virtual void OnViewDetached()
Definition: sprk.h:1203
Definition: hps.h:41100
LayoutDeletedEvent()
Definition: sprk.h:765
Event * Clone() const
Definition: sprk.h:945
virtual void OnViewAttached()
Definition: sprk.h:1200
Definition: hps.h:40485
Definition: hps.h:43702
Definition: hps.h:1095
Definition: sprk.h:2731
LayoutDetachedEvent()
Definition: sprk.h:720
Definition: sprk.h:2845
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1162
Definition: hps.h:9765
Definition: hps.h:42164
Definition: hps.h:1508
SmoothTransitionCompleteEvent()
Definition: sprk.h:3237
Definition: hps.h:1440
Event * Clone() const
Definition: sprk.h:2372
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1142
FilterActivationEvent()
Definition: sprk.h:2499
Definition: hps.h:1459
virtual void OnModelAttached()
Definition: sprk.h:1207
Definition: hps.h:38235
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2513
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:929
Definition: hps.h:7078
Location
Definition: sprk.h:1601
Definition: hps.h:46918
Definition: sprk.h:2796
Definition: sprk.h:1597
Definition: hps.h:43881
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:229
Definition: hps.h:45813
virtual UTF8 GetName() const
Definition: sprk.h:1132
Definition: hps.h:47334
Definition: sprk.h:716
Event * Clone() const
Definition: sprk.h:2530
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2602
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1167
CanvasDeletedEvent()
Definition: sprk.h:677
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1152
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:224
Event * Clone() const
Definition: sprk.h:2618
Definition: hps.h:15442
ViewDeletedEvent()
Definition: sprk.h:871
intptr_t GetChannel() const
Definition: hps.h:6318
Definition: sprk.h:804
SprocketKit(SprocketKit &&in_that)
Definition: sprk.h:252
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:3269
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3176
Definition: sprk.h:1735
Definition: hps.h:44160
Definition: hps.h:46425
virtual bool OnTextInput(HPS::UTF8 const &in_text)
Definition: sprk.h:1192
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:886
Definition: hps.h:37796
Definition: sprk.h:2943
ViewDetachedEvent()
Definition: sprk.h:815
Definition: hps.h:6285
Override the visibility for any components in the subtree under the ComponentPath specified regardles...
Definition: sprk.h:1301
Definition: hps.h:406
Event * Clone() const
Definition: sprk.h:2430
Definition: sprk.h:477
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:692
Definition: sprk.h:3296
Definition: sprk.h:2061
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:1030
ComponentType
Definition: sprk.h:1751
Definition: hps.h:45738
std::vector< Key, Allocator< Key > > KeyArray
Array of type HPS::Key.
Definition: hps.h:6639
Definition: hps.h:2110
Definition: sprk.h:2384
Event * Clone() const
Definition: sprk.h:707
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:735
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1137
ItemType
Definition: sprk.h:3425
Definition: sprk.h:2443
Definition: sprk.h:3097
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3303
Definition: sprk.h:185
Definition: sprk.h:3233
Definition: hps.h:425
Event * Clone() const
Definition: sprk.h:989
Definition: sprk.h:2543
Definition: hps.h:2130
ModelDetachedEvent()
Definition: sprk.h:914
static MouseButtons ButtonLeft()
Definition: hps.h:47036
Definition: sprk.h:3420
Definition: sprk.h:2894
UpdateType
Definition: hps.h:178
Definition: hps.h:9092
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1229
Definition: hps.h:7625
Definition: sprk.h:2488
Definition: hps.h:37409
Definition: hps.h:351
Event * Clone() const
Definition: sprk.h:3260
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:974
Event * Clone() const
Definition: sprk.h:855
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:780
Definition: hps.h:9321
Definition: hps.h:10870
Definition: sprk.h:1244
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1177
Definition: sprk.h:3700
Definition: sprk.h:2630
Definition: hps.h:42696
Mode
Definition: sprk.h:190
Definition: hps.h:511
Definition: sprk.h:1100
Definition: hps.h:1138
Definition: hps.h:42046
Definition: sprk.h:867
Definition: sprk.h:2584
Definition: hps.h:40549
Definition: hps.h:7336
Event * Clone() const
Definition: sprk.h:1047