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 
331  HPS::View & FitWorld(SegmentKey const & in_segment);
332 
333 
336  HPS::View & FitWorld(BoundingKit const & in_bounding);
337 
343  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
344 
345 
350  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
351 
356  void AttachModel(Model const & in_model);
357 
359  void DetachModel();
360 
362  Model GetAttachedModel() const;
363 
365  IncludeKey GetAttachedModelIncludeLink() const;
366 
370  void SetRenderingMode(Rendering::Mode in_mode);
371 
374  Rendering::Mode GetRenderingMode() const;
375 
377  OperatorPtrArray GetOperators() const;
378 
381  void SetOperators(OperatorPtrArray & in_operators);
382 
386  void SetOperators(size_t in_count, OperatorPtr in_operators []);
387 
390  void SetOperator(OperatorPtr const & in_operator);
391 
395  void SetOperator(Operator * in_operator);
396 
398  OperatorControl GetOperatorControl();
399  OperatorControl const GetOperatorControl() const;
400 
402  NavigationCubeControl GetNavigationCubeControl();
403  NavigationCubeControl const GetNavigationCubeControl() const;
404 
406  AxisTriadControl GetAxisTriadControl();
407  AxisTriadControl const GetAxisTriadControl() const;
408 
411  SegmentKey GetSegmentKey();
412  SegmentKey const GetSegmentKey() const;
413 
416  SegmentKey GetModelOverrideSegmentKey();
417  SegmentKey const GetModelOverrideSegmentKey() const;
418 
419 
420  PortfolioKey const GetPortfolioKey() const;
421 
423  PortfolioKey GetPortfolioKey();
424 
429  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
430 
432  bool GetSimpleShadow();
433 
438  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
439 
441  bool GetSimpleReflection();
442 
444  void Update() const;
445 
448  UpdateNotifier UpdateWithNotifier() const;
449 
453  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
454 
460  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
461 
465  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
466 
467  static UTF8 GetHideStyleName();
468  static UTF8 GetShowStyleName();
469 
471  KeyArray const GetNavigationKeys();
472 
474  LayoutArray GetOwningLayouts();
475  LayoutArray const GetOwningLayouts() const;
476 };
477 
481 class SPRK_API Model : public Sprocket
482 {
483 public:
484  Model();
485  Model(Model const & that);
486  ~Model();
487 
488  static const HPS::Type staticType = HPS::Type::Model;
489  HPS::Type ObjectType() const { return staticType; }
490 
492  void Delete();
493 
494  Model & operator=(Model const & in_that);
495  void Assign(Model const & in_that);
496 
497  bool Equals(Model const & in_that) const;
498  bool operator!= (Model const & in_that) const;
499  bool operator== (Model const & in_that) const;
500 
502  UTF8 GetName() const;
503 
506  SegmentKey GetSegmentKey();
507  SegmentKey const GetSegmentKey() const;
508 
510  SegmentKey GetLibraryKey();
511  SegmentKey const GetLibraryKey() const;
512 
514  PortfolioKey GetPortfolioKey();
515  PortfolioKey const GetPortfolioKey() const;
516 
518  HPS::Vector GetUpVector();
519  HPS::Vector const GetUpVector() const;
520 
522  HPS::Vector GetFrontVector();
523  HPS::Vector const GetFrontVector() const;
524 
526  HPS::ViewArray GetOwningViews();
527  HPS::ViewArray const GetOwningViews() const;
528 
532  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
533 
535  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector) const;
536 
538  void Update() const;
539 
542  UpdateNotifier UpdateWithNotifier() const;
543 
547  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
548 
554  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
555 
556 };
557 
561 class SPRK_API Layout : public Sprocket
562 {
563 public:
564  Layout();
565  Layout(Layout const & that);
566  ~Layout();
567 
568  static const HPS::Type staticType = HPS::Type::Layout;
569  HPS::Type ObjectType() const { return staticType; }
570 
572  void Delete();
573 
574  Layout & operator=(Layout const & in_that);
575  void Assign(Layout const & in_that);
576 
577  bool Equals(Layout const & in_that) const;
578  bool operator!= (Layout const & in_that) const;
579  bool operator== (Layout const & in_that) const;
580 
582  UTF8 GetName() const;
583 
585  size_t GetLayerCount() const;
586 
590  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
594  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
595 
598  void DetachLayer(size_t in_layer);
599 
602  void DetachView(View const & in_view); // everywhere it occurs
603 
606  void BringToFront(size_t in_layer);
607 
611  void ReassignLayer(size_t in_layer, HPS::View in_view);
612 
616  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
617 
619  View GetFrontView() const;
620 
624  View GetAttachedView(size_t in_layer = 0) const;
625 
629  Rectangle GetPosition(size_t in_layer) const;
630 
632  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
633 
635  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
636 
640  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
641 
645  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
646 
649  SegmentKey GetSegmentKey();
650  SegmentKey const GetSegmentKey() const;
651 
653  CanvasArray GetOwningCanvases();
654  CanvasArray const GetOwningCanvases() const;
655 
657  void Update() const;
658 
661  UpdateNotifier UpdateWithNotifier() const;
662 
666  void Update(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
667 
673  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateType in_type, HPS::Time in_time_limit = -1.0) const;
674 
675 };
676 
677 class SPRK_API CanvasDeletedEvent : public Event
678 {
679 public:
682  {
683  channel = GetClassID();
684  consumable = false;
685  }
686 
687  CanvasDeletedEvent(Canvas const & in_canvas)
688  : Event(), canvas(in_canvas)
689  {
690  channel = GetClassID();
691  consumable = false;
692  }
693 
696  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
697  {
698  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
699  {
700  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
701  canvas = that.canvas;
702  }
703  else
704  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
705  }
706 
708 
711  Event * Clone() const
712  {
713  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
714  return new_event;
715  }
716 
717  Canvas canvas;
718 };
719 
720 class SPRK_API LayoutDetachedEvent : public Event
721 {
722 public:
725  {
726  channel = GetClassID();
727  consumable = false;
728  }
729 
730  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
731  : Event(), canvas(in_canvas), layout(in_layout)
732  {
733  channel = GetClassID();
734  consumable = false;
735  }
736 
739  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
740  {
741  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
742  {
743  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
744  canvas = that.canvas;
745  layout = that.layout;
746  }
747  else
748  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
749  }
750 
752 
755  Event * Clone() const
756  {
757  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
758  return new_event;
759  }
760 
761  Canvas canvas;
762  Layout layout;
763 };
764 
765 class SPRK_API LayoutDeletedEvent : public Event
766 {
767 public:
770  {
771  channel = GetClassID();
772  consumable = false;
773  }
774 
775  LayoutDeletedEvent(Layout const & in_layout)
776  : Event(), layout(in_layout)
777  {
778  channel = GetClassID();
779  consumable = false;
780  }
781 
784  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
785  {
786  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
787  {
788  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
789  layout = that.layout;
790  }
791  else
792  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
793  }
794 
796 
799  Event * Clone() const
800  {
801  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
802  return new_event;
803  }
804 
805  Layout layout;
806 };
807 
808 class SPRK_API ViewDetachedEvent : public Event
809 {
810 public:
811  enum class Action
812  {
813  None = 0,
814  SpecificLayer,
815  AllLayers,
816  };
817 
819  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
820  {
821  channel = GetClassID();
822  consumable = false;
823  }
824 
825  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
826  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
827  {
828  channel = GetClassID();
829  consumable = false;
830  }
831 
832  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
833  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
834  {
835  channel = GetClassID();
836  consumable = false;
837  }
838 
841  ViewDetachedEvent(Event const & in_event) : Event(in_event)
842  {
843  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
844  {
845  auto that = static_cast<ViewDetachedEvent const &>(in_event);
846  layout = that.layout;
847  action = that.action;
848  layer = that.layer;
849  view = that.view;
850  }
851  else
852  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
853  }
854 
856 
859  Event * Clone() const
860  {
861  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
862  return new_event;
863  }
864 
865  Layout layout;
866  Action action;
867  size_t layer;
868  View view;
869 };
870 
871 class SPRK_API ViewDeletedEvent : public Event
872 {
873 public:
876  {
877  channel = GetClassID();
878  consumable = false;
879  }
880 
881  ViewDeletedEvent(View const & in_view)
882  : Event(), view(in_view)
883  {
884  channel = GetClassID();
885  consumable = false;
886  }
887 
890  ViewDeletedEvent(Event const & in_event) : Event(in_event)
891  {
892  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
893  {
894  auto that = static_cast<ViewDeletedEvent const &>(in_event);
895  view = that.view;
896  }
897  else
898  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
899  }
900 
901  ~ViewDeletedEvent();
902 
905  Event * Clone() const
906  {
907  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
908  return new_event;
909  }
910 
911  View view;
912 };
913 
914 class SPRK_API ModelDetachedEvent : public Event
915 {
916 public:
919  {
920  channel = GetClassID();
921  consumable = false;
922  }
923 
924  ModelDetachedEvent(View const & in_view, Model const & in_model)
925  : Event(), view(in_view), model(in_model)
926  {
927  channel = GetClassID();
928  consumable = false;
929  }
930 
933  ModelDetachedEvent(Event const & in_event) : Event(in_event)
934  {
935  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
936  {
937  auto that = static_cast<ModelDetachedEvent const &>(in_event);
938  view = that.view;
939  model = that.model;
940  }
941  else
942  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
943  }
944 
946 
949  Event * Clone() const
950  {
951  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
952  return new_event;
953  }
954 
955  View view;
956  Model model;
957 };
958 
959 class SPRK_API ModelDeletedEvent : public Event
960 {
961 public:
964  {
965  channel = GetClassID();
966  consumable = false;
967  }
968 
969  ModelDeletedEvent(Model const & in_model)
970  : Event(), model(in_model)
971  {
972  channel = GetClassID();
973  consumable = false;
974  }
975 
978  ModelDeletedEvent(Event const & in_event) : Event(in_event)
979  {
980  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
981  {
982  auto that = static_cast<ModelDeletedEvent const &>(in_event);
983  model = that.model;
984  }
985  else
986  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
987  }
988 
990 
993  Event * Clone() const
994  {
995  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
996  return new_event;
997  }
998 
999  Model model;
1000 };
1001 
1002 class SPRK_API CameraChangedEvent : public Event
1003 {
1004 public:
1007  {
1008  channel = GetClassID();
1009  consumable = false;
1010  }
1011 
1012  CameraChangedEvent(View const & in_view)
1013  : Event(), view(in_view)
1014  {
1015  channel = GetClassID();
1016  consumable = false;
1017  }
1018 
1021  CameraChangedEvent(Event const & in_event) : Event(in_event)
1022  {
1023  if (in_event.GetChannel() == Object::ClassID<CameraChangedEvent>())
1024  {
1025  auto that = static_cast<CameraChangedEvent const &>(in_event);
1026  view = that.view;
1027  }
1028  else
1029  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
1030  }
1031 
1032  ~CameraChangedEvent();
1033 
1034  virtual bool Drop(Event const * in_that_event) const
1035  {
1036  CameraChangedEvent const * that_event = static_cast<CameraChangedEvent const *>(in_that_event);
1037 
1038  if (view == that_event->view)
1039  return true;
1040 
1041  return false;
1042  }
1043 
1044  virtual intptr_t Freshen() const
1045  {
1046  return GetClassID();
1047  }
1048 
1051  Event * Clone() const
1052  {
1053  CameraChangedEvent * new_event = new CameraChangedEvent(*this);
1054  return new_event;
1055  }
1056 
1057  View view;
1058 };
1059 
1062 class SPRK_API SprocketPath : public Sprocket
1063 {
1064 public:
1065  SprocketPath();
1066  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
1067  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
1068  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
1069  SprocketPath(SprocketPath const & that);
1070  ~SprocketPath();
1071 
1072  static const HPS::Type staticType = HPS::Type::SprocketPath;
1073  HPS::Type ObjectType() const { return staticType; }
1074 
1075  SprocketPath & operator=(SprocketPath const & in_that);
1076  void Set(SprocketPath const & in_that);
1077 
1078  bool Equals(SprocketPath const & in_that) const;
1079  bool operator!= (SprocketPath const & in_that) const;
1080  bool operator== (SprocketPath const & in_that) const;
1081 
1083  Canvas GetCanvas() const;
1084 
1086  Layout GetLayout() const;
1087 
1089  View GetView() const;
1090 
1092  Model GetModel() const;
1093 
1098  KeyPath GetKeyPath() const;
1099 };
1100 
1101 
1104 class SPRK_API Operator : public Sprocket
1105 {
1106 public:
1107  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
1108  Operator(Operator const & in_that);
1109 
1110  virtual ~Operator();
1111 
1112  static const HPS::Type staticType = HPS::Type::Operator;
1113  HPS::Type ObjectType() const { return staticType; }
1114 
1115  virtual Operator & operator= (Operator const & in_that);
1116 
1118  virtual void Assign(Operator const & in_that);
1119 
1121  virtual bool Equals(Operator const & in_that) const;
1122 
1124  virtual bool operator!= (Operator const & in_that) const;
1125 
1127  virtual bool operator== (Operator const & in_that) const;
1128 
1130  void DetachView();
1131 
1133  View GetAttachedView() const;
1134 
1136  virtual UTF8 GetName() const { return "Operator"; }
1137 
1141  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1142 
1146  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1147 
1151  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1152 
1156  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1157 
1161  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1162 
1166  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1167 
1171  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1172 
1176  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1177 
1181  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1182 
1186  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1187 
1191  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1192 
1196  virtual bool OnTextInput(HPS::UTF8 const & in_text) { HPS_UNREFERENCED(in_text); return false; }
1197 
1201  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1202 
1204  virtual void OnViewAttached() { return; }
1205 
1207  virtual void OnViewDetached() { return; }
1208 
1211  virtual void OnModelAttached() { return; }
1212 
1215  virtual void OnModelDetached() { return; }
1216 
1218  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1219 
1222  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1223 
1227  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1228 
1230  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1231 
1233  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1234 
1235  enum class Priority
1236  {
1237  Low,
1238  Default,
1239  High
1240  };
1241 
1242 protected:
1243 
1244  HPS::MouseButtons mouse_trigger;
1245  HPS::ModifierKeys modifier_trigger;
1246 };
1247 
1248 class SPRK_API OperatorUtility
1249 {
1250  static double internal_acos(double x)
1251  {
1252  return (((x)<-1) ? (HPS::PI) : (((x)>1) ? (0) : (acos(x))));
1253  }
1254 
1255 public:
1256 
1257  enum ProjectedPlane
1258  {
1259  Plane_XY,
1260  Plane_YZ,
1261  Plane_XZ
1262  };
1263 
1264  static void ScreenToSphereMousePoint(HPS::Point const &in_pt, HPS::Vector &out_vec)
1265  {
1266  out_vec = HPS::Vector(in_pt);
1267  float len = static_cast<float>(out_vec.Length());
1268  if (len > 1.0f)
1269  {
1270  out_vec /= len;
1271  out_vec.z = 0;
1272  }
1273  else
1274  out_vec.z = (float)sqrt(1.0f - (len*len));
1275  }
1276 
1277  static float CalculateAngleOrbitOnPlane(HPS::Vector const &axis, ProjectedPlane plane)
1278  {
1279  float theta;
1280 
1281  HPS::Vector vtmp;
1282  if (plane == Plane_XY)
1283  vtmp = HPS::Vector(axis.x, axis.y, 0);
1284  else if (plane == Plane_YZ)
1285  vtmp = HPS::Vector(0, axis.y, axis.z);
1286  else
1287  vtmp = HPS::Vector(axis.x, 0, axis.z);
1288  Vector naxis = axis;
1289 
1290  naxis.Normalize();
1291  vtmp.Normalize();
1292 
1293  float tmp = naxis.Dot(vtmp);
1294  if (static_cast<float>(Abs(tmp)) > 1.001f || static_cast<float>(Abs(tmp)) < 0.999f)
1295  theta = static_cast<float>(internal_acos(tmp));
1296  else
1297  theta = 0.0f;
1298 
1299  return theta;
1300  }
1301 };
1302 
1305 class SPRK_API OperatorControl : public SprocketControl
1306 {
1307 public:
1309  explicit OperatorControl(View const & in_view);
1310 
1312  OperatorControl(OperatorControl const & in_that);
1313 
1317  OperatorControl(OperatorControl && in_that);
1318 
1322  OperatorControl & operator=(OperatorControl && in_that);
1323 
1325  ~OperatorControl();
1326 
1327  static const HPS::Type staticType = HPS::Type::OperatorControl;
1328  HPS::Type ObjectType() const {return staticType;};
1329 
1331  OperatorControl & operator=(OperatorControl const & in_that);
1332 
1333 
1335  size_t GetCount();
1336 
1339  size_t GetCount(Operator::Priority in_priority);
1340 
1341 
1347  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1348 
1355  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1356 
1360  bool Pop(Operator::Priority in_priority = Operator::Priority::Default);
1361 
1366  bool Pop(OperatorPtr & out_operator);
1367 
1373  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1374 
1375 
1381  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1382 
1389  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Default);
1390 
1396  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Default);
1397 
1404  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Default);
1405 
1406 
1410  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Default);
1411 
1415  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1416 
1419  OperatorControl & UnsetEverything();
1420 
1421 
1425  bool ShowTop(OperatorPtr & out_operator) const;
1426 
1431  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1432 
1436  bool Show(OperatorPtrArray & out_operators) const;
1437 
1442  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1443 
1444 private:
1446  OperatorControl() {}
1447 };
1448 
1455 {
1456 public:
1457 
1458  enum class Location
1459  {
1460  TopRight,
1461  TopLeft,
1462  BottomRight,
1463  BottomLeft,
1464  Custom,
1465  };
1466 
1468  explicit NavigationCubeControl(View const & in_view);
1469 
1472 
1477 
1481  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1482 
1485 
1486  static const HPS::Type staticType = HPS::Type::NavigationCubeControl;
1487  HPS::Type ObjectType() const {return staticType;};
1488 
1490  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1491 
1500  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1501 
1504  Location GetLocation() const;
1505 
1509  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1510 
1513  HPS::Rectangle GetPosition() const;
1514 
1518  NavigationCubeControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1519 
1522  HPS::IntRectangle GetPositionOffsets() const;
1523 
1528  NavigationCubeControl & SetVisibility(bool in_visibility);
1529 
1532  bool GetVisibility() const;
1533 
1537  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1538 
1541  bool GetTextVisibility() const;
1542 
1557  NavigationCubeControl & SetMaterialPalette(char const * in_material_palette);
1558 
1561  HPS::UTF8 GetMaterialPalette() const;
1562 
1570  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1571 
1572 
1575  bool GetInteractivity() const;
1576 
1581  NavigationCubeControl & SetSize(float in_size);
1582 
1585  float GetSize() const;
1586 
1589  HPS::SegmentKey GetSegmentKey() const;
1590 
1591 private:
1593  NavigationCubeControl() {}
1594 
1596  HPS::SegmentKey GetNavigationCubeSegment() const;
1597 };
1598 
1601 class SPRK_API AxisTriadControl : public SprocketControl
1602 {
1603 public:
1604 
1605  enum class Location
1606  {
1607  TopRight,
1608  TopLeft,
1609  BottomRight,
1610  BottomLeft,
1611  Custom,
1612  };
1613 
1615  explicit AxisTriadControl(View const & in_view);
1616 
1618  AxisTriadControl(AxisTriadControl const & in_that);
1619 
1623  AxisTriadControl(AxisTriadControl && in_that);
1624 
1628  AxisTriadControl & operator=(AxisTriadControl && in_that);
1629 
1631  ~AxisTriadControl();
1632 
1633  static const HPS::Type staticType = HPS::Type::AxisTriadControl;
1634  HPS::Type ObjectType() const {return staticType;};
1635 
1637  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1638 
1647  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_position = HPS::Rectangle(), HPS::IntRectangle in_offsets = HPS::IntRectangle::Zero());
1648 
1651  Location GetLocation() const;
1652 
1656  AxisTriadControl & SetPosition(HPS::Rectangle const & in_position);
1657 
1660  HPS::Rectangle GetPosition() const;
1661 
1665  AxisTriadControl & SetPositionOffsets(HPS::IntRectangle const & in_offsets);
1666 
1669  HPS::IntRectangle GetPositionOffsets() const;
1670 
1675  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1676 
1679  bool GetVisibility() const;
1680 
1684  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1685 
1688  bool GetTextVisibility() const;
1689 
1698  HPS::AxisTriadControl & SetMaterialPalette(char const * in_material_palette);
1699 
1702  HPS::UTF8 GetMaterialPalette() const;
1703 
1710  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1711 
1714  bool GetInteractivity() const;
1715 
1720  AxisTriadControl & SetSize(float in_size);
1721 
1724  float GetSize() const;
1725 
1728  HPS::SegmentKey GetSegmentKey() const;
1729 
1730 private:
1732  AxisTriadControl(){};
1733 
1735  HPS::SegmentKey GetAxisTriadSegment() const;
1736 };
1737 
1739 class SPRK_API Component : public Sprocket
1740 {
1741 public:
1742 
1745  enum class Visibility : uint32_t
1746  {
1747  PreserveUserDefined,
1748  PreserveModelDefined,
1749  PreserveNone,
1750  PreserveAll,
1751  };
1752 
1755  enum class ComponentType : uint32_t
1756  {
1757  None = 0x00000000,
1758  GenericMask = 0xfffff000,
1759 
1760  ExchangeComponentMask = 0x00001000,
1761  ExchangeModelFile = 0x00001001,
1762  ExchangeProductOccurrence = 0x00001002,
1763  ExchangePartDefinition = 0x00001003,
1764 
1765  ExchangeView = 0x00001004,
1766  ExchangeFilter = 0x00001005,
1767 
1768  ExchangeRepresentationItemMask = 0x00003000,
1769  ExchangeRIBRepModel = 0x00003001,
1770  ExchangeRICurve = 0x00003002,
1771  ExchangeRIDirection = 0x00003003,
1772  ExchangeRIPlane = 0x00003004,
1773  ExchangeRIPointSet = 0x00003005,
1774  ExchangeRIPolyBRepModel = 0x00003006,
1775  ExchangeRIPolyWire = 0x00003007,
1776  ExchangeRISet = 0x00003008,
1777  ExchangeRICoordinateSystem = 0x00003009,
1778 
1779  ExchangeTopologyMask = 0x00005000,
1780  ExchangeTopoBody = 0x00005001,
1781  ExchangeTopoConnex = 0x00005002,
1782  ExchangeTopoShell = 0x00005003,
1783  ExchangeTopoFace = 0x00005004,
1784  ExchangeTopoLoop = 0x00005005,
1785  ExchangeTopoCoEdge = 0x00005006,
1786  ExchangeTopoEdge = 0x00005007,
1787  ExchangeTopoVertex = 0x00005008,
1788  ExchangeTopoSingleWireBody = 0x00005009,
1789  ExchangeTopoWireEdge = 0x0000500a,
1790 
1791  ExchangeDrawingMask = 0x00009000,
1792  ExchangeDrawingModel = 0x00009001,
1793  ExchangeDrawingView = 0x00009002,
1794  ExchangeDrawingSheet = 0x00009003,
1795  ExchangeBasicDrawingBlock = 0x00009004,
1796  ExchangeOperatorDrawingBlock = 0x00009005,
1797 
1798  ExchangePMIMask = 0x00011000,
1799  ExchangePMI = ExchangePMIMask,
1800  ExchangePMIText = 0x00011100,
1801  ExchangePMIRichText = 0x00011200,
1802  ExchangePMIRoughness = 0x00011300,
1803  ExchangePMIGDT = 0x00011400,
1804  ExchangePMIDatum = 0x00011500,
1805  ExchangePMILineWelding = 0x00011600,
1806  ExchangePMISpotWelding = 0x00011700,
1807  ExchangePMIDimension = 0x00011800,
1808  ExchangePMIBalloon = 0x00011900,
1809  ExchangePMICoordinate = 0x00011a00,
1810  ExchangePMIFastener = 0x00011b00,
1811  ExchangePMILocator = 0x00011c00,
1812  ExchangePMIMeasurementPoint = 0x00011d00,
1813 
1814 
1815  ParasolidComponentMask = 0x00020000,
1816 
1817  ParasolidModelFile = 0x00020001,
1818  ParasolidAssembly = 0x00020002,
1819  ParasolidInstance = 0x00020003,
1820 
1821  ParasolidTopologyMask = 0x00060000,
1822  ParasolidTopoBody = 0x00060001,
1823  ParasolidTopoRegion = 0x00060002,
1824  ParasolidTopoShell = 0x00060003,
1825  ParasolidTopoFace = 0x00060004,
1826  ParasolidTopoLoop = 0x00060005,
1827  ParasolidTopoFin = 0x00060006,
1828  ParasolidTopoEdge = 0x00060007,
1829  ParasolidTopoVertex = 0x00060008,
1830 
1831 
1832  DWGComponentMask = 0x00100000,
1833  DWGModelFile = 0x00100001,
1834  DWGLayout = 0x00100002,
1835  DWGBlockTable = 0x00100003,
1836  DWGBlockTableRecord = 0x00100004,
1837  DWGEntity = 0x00100005,
1838  DWGLayerTable = 0x00100006,
1839  DWGLayer = 0x00100007,
1840 
1841 
1842  UserComponent = 0x01000000,
1843  };
1844 
1845 
1847  Component();
1848 
1851  Component(Component const & in_that);
1852 
1855  Component(Component && in_that);
1856 
1858  virtual ~Component();
1859 
1860  static const HPS::Type staticType = HPS::Type::Component;
1861  HPS::Type ObjectType() const { return staticType; }
1862 
1863 
1867  Component & operator=(Component const & in_that);
1868 
1872  Component & operator=(Component && in_that);
1873 
1877  virtual void Assign(Component const & in_that);
1878 
1882  bool Equals(Component const & in_that) const;
1883 
1887  bool operator!=(Component const & in_that) const;
1888 
1892  bool operator==(Component const & in_that) const;
1893 
1894 
1897  ComponentType GetComponentType() const;
1898 
1902  bool HasComponentType(ComponentType in_mask) const;
1903 
1904 
1905 
1911  void AddKey(Key const & in_key);
1912 
1915  KeyArray GetKeys() const;
1916 
1917 
1918 
1923  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1924 
1928  ComponentArray GetOwners() const;
1929 
1932  ComponentArray GetSubcomponents() const;
1933 
1938  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1939 
1940 
1941 
1944  void AddReference(Component & in_reference);
1945 
1948  ComponentArray GetReferrers() const;
1949 
1953  ComponentArray GetReferences() const;
1954 
1955 
1956 
1959  MetadataArray GetAllMetadata() const;
1960 
1964  Metadata GetMetadata(char const * in_name) const;
1965 
1969  UTF8 GetName() const;
1970 
1971 
1972 
2025  void Delete();
2026 
2030  void Flush();
2031 
2032 
2040  static KeyPathArray GetKeyPath(Component const & in_component);
2041 
2051  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
2052 
2061  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
2062 };
2063 
2065 class SPRK_API ComponentPath : public Sprocket
2066 {
2067 public:
2069  ComponentPath();
2070 
2073  ComponentPath(ComponentArray const & in_components);
2074 
2078  ComponentPath(size_t in_count, Component const in_components[]);
2079 
2081  ComponentPath(ComponentPath const & in_that);
2082 
2086  ComponentPath(ComponentPath && in_that);
2087 
2091  ComponentPath & operator=(ComponentPath && in_that);
2092 
2094  virtual ~ComponentPath();
2095 
2096  static const HPS::Type staticType = HPS::Type::ComponentPath;
2097  HPS::Type ObjectType() const { return staticType; }
2098 
2101  bool Empty() const;
2102 
2106  ComponentPath & operator+=(Component const & in_component);
2107 
2111  ComponentPath & operator+=(ComponentPath const & in_path);
2112 
2116  ComponentPath & operator+=(ComponentArray const & in_components);
2117 
2121  ComponentPath & Append(Component const & in_component);
2122 
2126  ComponentPath & Append(ComponentPath const & in_path);
2127 
2131  ComponentPath & Append(ComponentArray const & in_components);
2132 
2136  ComponentPath & operator=(ComponentPath const & in_that);
2137 
2141  ComponentPath & operator=(ComponentArray const & in_path);
2142 
2145  void Set(ComponentPath const & in_that);
2146 
2150  bool Equals(ComponentPath const & in_that) const;
2151 
2155  bool operator!= (ComponentPath const & in_that) const;
2156 
2160  bool operator== (ComponentPath const & in_that) const;
2161 
2162 
2166  ComponentPath & SetComponents(ComponentArray const & in_components);
2167 
2172  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
2173 
2176  ComponentArray GetComponents() const;
2177 
2181  KeyPathArray GetKeyPaths() const;
2182 
2187  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
2188 
2189 
2196  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options, bool in_remove_existing = true) const;
2197 
2204  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options, bool in_remove_existing = true) const;
2205 
2209  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2210 
2215  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options = HighlightOptionsKit()) const;
2216 
2217 
2222  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
2223 
2228  void Show(Canvas const & in_canvas, size_t in_layer = 0, Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
2229 
2235  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
2236 
2243  void Isolate(Canvas const & in_canvas, size_t in_layer = 0, Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
2244 
2252  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);
2253 };
2254 
2255 
2260 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
2261 {
2262  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2263 }
2264 
2269 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
2270 {
2271  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2272 }
2273 
2278 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
2279 {
2280  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2281 }
2282 
2287 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
2288 {
2289  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2290 }
2291 
2296 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
2297 {
2298  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2299 }
2300 
2305 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
2306 {
2307  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2308 }
2309 
2314 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
2315 {
2316  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2317 }
2318 
2323 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2324 {
2325  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2326 }
2327 
2332 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2333 {
2334  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2335 }
2336 
2338 class SPRK_API ComponentIsolateEvent : public Event
2339 {
2340 public:
2341 
2344  {
2345  channel = GetClassID();
2346  consumable = false;
2347  subcomponent_visibility = Component::Visibility::PreserveNone;
2348  }
2349 
2350  ComponentIsolateEvent(ComponentPath const & in_path,
2351  Component::Visibility in_subcomponent_visibility)
2352  : Event(), path(in_path), subcomponent_visibility(in_subcomponent_visibility)
2353  {
2354  channel = GetClassID();
2355  consumable = false;
2356  }
2357 
2360  ComponentIsolateEvent(Event const & in_event) : Event(in_event)
2361  {
2362  if (in_event.GetChannel() == Object::ClassID<ComponentIsolateEvent>())
2363  {
2364  auto that = static_cast<ComponentIsolateEvent const &>(in_event);
2365  subcomponent_visibility = that.subcomponent_visibility;
2366  path = that.path;
2367  }
2368  else
2369  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2370  }
2371 
2373 
2376  Event * Clone() const
2377  {
2378  ComponentIsolateEvent * new_event = new ComponentIsolateEvent(*this);
2379  return new_event;
2380  }
2381 
2382  ComponentPath path;
2383  Component::Visibility subcomponent_visibility;
2384 };
2385 
2386 
2388 class SPRK_API ComponentHighlightEvent : public Event
2389 {
2390 public:
2391  enum class Action
2392  {
2393  None = 0,
2394  Highlight,
2395  Unhighlight,
2396  };
2397 
2400  {
2401  channel = GetClassID();
2402  consumable = false;
2403  action = Action::None;
2404  }
2405 
2406  ComponentHighlightEvent(Action in_action,
2407  ComponentPath const & in_path = ComponentPath(),
2408  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2409  : Event(), action(in_action), path(in_path), options(in_options)
2410  {
2411  channel = GetClassID();
2412  consumable = false;
2413  }
2414 
2417  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2418  {
2419  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2420  {
2421  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2422  action = that.action;
2423  path = that.path;
2424  options = that.options;
2425  }
2426  else
2427  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2428  }
2429 
2431 
2434  Event * Clone() const
2435  {
2436  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2437  return new_event;
2438  }
2439 
2440  Action action;
2441  ComponentPath path;
2442  HighlightOptionsKit options;
2443 };
2444 
2445 
2447 class SPRK_API Filter : public Component
2448 {
2449 public:
2451  Filter();
2452 
2456  Filter(Component const & in_that);
2457 
2460  Filter(Filter const & in_that);
2461 
2464  Filter(Filter && in_that);
2465 
2466  virtual ~Filter();
2467 
2468  static const HPS::Type staticType = HPS::Type::Filter;
2469  HPS::Type ObjectType() const { return staticType; }
2470 
2471 
2472 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2473  Filter & operator=(Filter const & in_that) = default;
2474 #endif
2475 
2479  Filter & operator=(Filter && in_that);
2480 
2481 
2484  void Activate(View const & in_view);
2485 
2488  void Deactivate(View const & in_view);
2489 };
2490 
2491 
2492 class SPRK_API FilterActivationEvent : public Event
2493 {
2494 public:
2495  enum class Action
2496  {
2497  None = 0,
2498  Activate,
2499  Deactivate,
2500  };
2501 
2504  {
2505  channel = GetClassID();
2506  consumable = false;
2507  }
2508 
2509  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2510  {
2511  channel = GetClassID();
2512  consumable = false;
2513  }
2514 
2517  FilterActivationEvent(Event const & in_event) : Event(in_event)
2518  {
2519  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2520  {
2521  auto that = static_cast<FilterActivationEvent const &>(in_event);
2522  filter = that.filter;
2523  action = that.action;
2524  view = that.view;
2525  }
2526  else
2527  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2528  }
2529 
2531 
2534  Event * Clone() const
2535  {
2536  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2537  return new_event;
2538  }
2539 
2540  Filter filter;
2541  Action action;
2542  View view;
2543 };
2544 
2545 
2547 class SPRK_API Capture : public Component
2548 {
2549 public:
2551  Capture();
2552 
2556  Capture(Component const & in_that);
2557 
2560  Capture(Capture const & in_that);
2561 
2564  Capture(Capture && in_that);
2565 
2566  virtual ~Capture();
2567 
2568  static const HPS::Type staticType = HPS::Type::Capture;
2569  HPS::Type ObjectType() const { return staticType; }
2570 
2571 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2572  Capture & operator=(Capture const & in_that) = default;
2573 #endif
2574 
2578  Capture & operator=(Capture && in_that);
2579 
2580 
2584  View Activate();
2585 };
2586 
2587 
2588 class SPRK_API CaptureActivationEvent : public Event
2589 {
2590 public:
2593  {
2594  channel = GetClassID();
2595  consumable = false;
2596  }
2597 
2598  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2599  {
2600  channel = GetClassID();
2601  consumable = false;
2602  }
2603 
2606  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2607  {
2608  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2609  {
2610  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2611  capture = that.capture;
2612  view = that.view;
2613  }
2614  else
2615  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2616  }
2617 
2619 
2622  Event * Clone() const
2623  {
2624  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2625  return new_event;
2626  }
2627 
2628  Capture capture;
2629  View view;
2630 };
2631 
2632 
2634 class SPRK_API CADModel : public Component
2635 {
2636 public:
2638  CADModel();
2639 
2643  CADModel(Component const & in_that);
2644 
2647  CADModel(CADModel const & in_that);
2648 
2651  CADModel(CADModel && in_that);
2652 
2655  CADModel(Model const & in_that);
2656 
2657  virtual ~CADModel();
2658 
2659  static const HPS::Type staticType = HPS::Type::CADModel;
2660  HPS::Type ObjectType() const { return staticType; }
2661 
2662 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2663  CADModel & operator=(CADModel const & in_that) = default;
2664 #endif
2665 
2669  CADModel & operator=(CADModel && in_that);
2670 
2671 
2675  Component GetComponentFromKey(Key const & in_key) const;
2676 
2684  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2685 
2694  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2695 
2696 
2699  Model GetModel() const;
2700 
2703  FilterArray GetAllFilters() const;
2704 
2707  CaptureArray GetAllCaptures() const;
2708 
2712  FilterArray GetActiveFilters(View const & in_view) const;
2713 
2714 
2718  View ActivateDefaultCapture();
2719 
2720 
2728  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2729 };
2730 
2731 
2732 
2735 class SPRK_API Metadata : public Sprocket
2736 {
2737 public:
2739  Metadata();
2740 
2743  Metadata(Metadata const & in_that);
2744 
2747  Metadata(Metadata && in_that);
2748 
2751  Metadata(char const * in_name);
2752 
2753  virtual ~Metadata();
2754 
2755  static const HPS::Type staticType = HPS::Type::Metadata;
2756  HPS::Type ObjectType() const { return staticType; }
2757 
2758 
2762  Metadata & operator=(Metadata const & in_that);
2763 
2767  Metadata & operator=(Metadata && in_that);
2768 
2772  virtual void Assign(Metadata const & in_that);
2773 
2777  bool Equals(Metadata const & in_that) const;
2778 
2782  bool operator!=(Metadata const & in_that) const;
2783 
2787  bool operator==(Metadata const & in_that) const;
2788 
2789 
2792  HPS::UTF8 GetName() const;
2793 
2796  void SetName(char const * in_name);
2797 };
2798 
2800 class SPRK_API IntegerMetadata : public Metadata
2801 {
2802 public:
2804  IntegerMetadata();
2805 
2809  IntegerMetadata(Metadata const & in_that);
2810 
2813  IntegerMetadata(IntegerMetadata const & in_that);
2814 
2817  IntegerMetadata(IntegerMetadata && in_that);
2818 
2822  IntegerMetadata(char const * in_name, int in_value);
2823 
2824  virtual ~IntegerMetadata();
2825 
2826  static const HPS::Type staticType = HPS::Type::IntegerMetadata;
2827  HPS::Type ObjectType() const { return staticType; }
2828 
2829 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2830  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2831 #endif
2832 
2836  IntegerMetadata & operator=(IntegerMetadata && in_that);
2837 
2838 
2841  int GetValue() const;
2842 
2845  void SetValue(int in_value);
2846 };
2847 
2849 class SPRK_API UnsignedIntegerMetadata : public Metadata
2850 {
2851 public:
2854 
2858  UnsignedIntegerMetadata(Metadata const & in_that);
2859 
2863 
2867 
2871  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2872 
2873  virtual ~UnsignedIntegerMetadata();
2874 
2875  static const HPS::Type staticType = HPS::Type::UnsignedIntegerMetadata;
2876  HPS::Type ObjectType() const { return staticType; }
2877 
2878 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2879  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2880 #endif
2881 
2885  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2886 
2887 
2890  unsigned int GetValue() const;
2891 
2894  void SetValue(unsigned int in_value);
2895 };
2896 
2898 class SPRK_API DoubleMetadata : public Metadata
2899 {
2900 public:
2902  DoubleMetadata();
2903 
2907  DoubleMetadata(Metadata const & in_that);
2908 
2911  DoubleMetadata(DoubleMetadata const & in_that);
2912 
2915  DoubleMetadata(DoubleMetadata && in_that);
2916 
2920  DoubleMetadata(char const * in_name, double in_value);
2921 
2922  virtual ~DoubleMetadata();
2923 
2924  static const HPS::Type staticType = HPS::Type::DoubleMetadata;
2925  HPS::Type ObjectType() const { return staticType; }
2926 
2927 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2928  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2929 #endif
2930 
2934  DoubleMetadata & operator=(DoubleMetadata && in_that);
2935 
2936 
2939  double GetValue() const;
2940 
2943  void SetValue(double in_value);
2944 };
2945 
2947 class SPRK_API StringMetadata : public Metadata
2948 {
2949 public:
2951  StringMetadata();
2952 
2956  StringMetadata(Metadata const & in_that);
2957 
2960  StringMetadata(StringMetadata const & in_that);
2961 
2964  StringMetadata(StringMetadata && in_that);
2965 
2969  StringMetadata(char const * in_name, char const * in_value);
2970 
2971  virtual ~StringMetadata();
2972 
2973  static const HPS::Type staticType = HPS::Type::StringMetadata;
2974  HPS::Type ObjectType() const { return staticType; }
2975 
2976 #if !defined(_MSC_VER) || _MSC_VER >= 1900
2977  StringMetadata & operator=(StringMetadata const & in_that) = default;
2978 #endif
2979 
2983  StringMetadata & operator=(StringMetadata && in_that);
2984 
2985 
2988  UTF8 GetValue() const;
2989 
2992  void SetValue(char const * in_value);
2993 };
2994 
2996 class SPRK_API TimeMetadata : public Metadata
2997 {
2998 public:
3000  TimeMetadata();
3001 
3005  TimeMetadata(Metadata const & in_that);
3006 
3009  TimeMetadata(TimeMetadata const & in_that);
3010 
3013  TimeMetadata(TimeMetadata && in_that);
3014 
3018  TimeMetadata(char const * in_name, unsigned int in_value);
3019 
3020  virtual ~TimeMetadata();
3021 
3022  static const HPS::Type staticType = HPS::Type::TimeMetadata;
3023  HPS::Type ObjectType() const { return staticType; }
3024 
3025 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3026  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
3027 #endif
3028 
3032  TimeMetadata & operator=(TimeMetadata && in_that);
3033 
3034 
3037  unsigned int GetValue() const;
3038 
3041  HPS::UTF8 GetValueAsString() const;
3042 
3045  void SetValue(unsigned int in_value);
3046 };
3047 
3048 
3050 class SPRK_API BooleanMetadata : public Metadata
3051 {
3052 public:
3054  BooleanMetadata();
3055 
3059  BooleanMetadata(Metadata const & in_that);
3060 
3063  BooleanMetadata(BooleanMetadata const & in_that);
3064 
3067  BooleanMetadata(BooleanMetadata && in_that);
3068 
3072  BooleanMetadata(char const * in_name, bool in_value);
3073 
3074  virtual ~BooleanMetadata();
3075 
3076  static const HPS::Type staticType = HPS::Type::BooleanMetadata;
3077  HPS::Type ObjectType() const { return staticType; }
3078 
3079 #if !defined(_MSC_VER) || _MSC_VER >= 1900
3080  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
3081 #endif
3082 
3086  BooleanMetadata & operator=(BooleanMetadata && in_that);
3087 
3088 
3091  bool GetValue() const;
3092 
3095  void SetValue(bool in_value);
3096 };
3097 
3098 
3099 
3101 class SPRK_API Factory : public Sprocket
3102 {
3103 public:
3104 
3107  static CanvasArray GetCanvases();
3108 
3111  static LayoutArray GetLayouts();
3112 
3115  static ViewArray GetViews();
3116 
3119  static ModelArray GetModels();
3120 
3123  static CADModelArray GetCADModels();
3124 
3130  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
3131 
3136  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
3137 
3143  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
3144 
3148  static Layout CreateLayout(char const * in_name = "");
3149 
3153  static View CreateView(char const * in_name = "");
3154 
3158  static Model CreateModel(char const * in_name = "");
3159 
3160  static Component CreateComponent(HPS::Component const & in_owner, char const * in_name = "");
3161 
3162 private:
3163  Factory() {}
3164 };
3165 
3175 class SPRK_API AxisTriadOperator : public Operator
3176 {
3177 public:
3178  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3180  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
3181 
3187  virtual bool OnMouseDown(MouseState const & in_state);
3192  virtual bool OnMouseUp(MouseState const & in_state);
3197  virtual bool OnMouseMove(MouseState const & in_state);
3198 
3203  virtual bool OnTouchDown(TouchState const & in_state);
3208  virtual bool OnTouchUp(TouchState const & in_state);
3213  virtual bool OnTouchMove(TouchState const & in_state);
3214 
3215  virtual void OnViewAttached();
3216 
3217 private:
3218 
3219  bool AxisOrbit(HPS::WindowPoint const & in_loc);
3220  void Transition(HPS::SelectionResults selection_results);
3221  void TranslatePoint(HPS::WindowPoint * point);
3222  bool IsEventRelevant(HPS::Point const & event_location);
3223 
3224  bool operator_active;
3225  HPS::WindowPoint start_point;
3226  HPS::Vector start_sphere_point;
3227  float axis_subwindow_width;
3228  float axis_subwindow_height;
3229  HPS::TouchID tracked_touch_ID;
3230  HPS::Rectangle axis_subwindow;
3231  HPS::IntRectangle axis_subwindow_offsets;
3232  HPS::SegmentKey axis_triad_segment;
3233 
3234 };
3235 
3238 {
3239 public:
3242  virtual ~SmoothTransitionCompleteEvent();
3243 
3246  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
3247  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
3248 
3251  SmoothTransitionCompleteEvent(Event const & in_event) : Event(in_event)
3252  {
3253  if (in_event.GetChannel() == Object::ClassID<SmoothTransitionCompleteEvent>())
3254  {
3255  auto that = static_cast<SmoothTransitionCompleteEvent const &>(in_event);
3256  view = that.view;
3257  }
3258  else
3259  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
3260  }
3261 
3264  Event * Clone() const
3265  {
3267  return new_event;
3268  }
3269 
3273  virtual bool Drop(Event const * in_that_event) const
3274  {
3275  HPS_UNREFERENCED(in_that_event);
3276  return false;
3277  }
3278 
3279  HPS::View view;
3280 };
3281 
3300 class SPRK_API NavigationCubeOperator : public Operator
3301 {
3302 public:
3303  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
3304  ~NavigationCubeOperator() { }
3305 
3307  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
3308 
3313  virtual bool OnMouseDown(MouseState const & in_state);
3318  virtual bool OnMouseUp(MouseState const & in_state);
3323  virtual bool OnMouseMove(MouseState const & in_state);
3324 
3328  virtual bool OnTouchDown(TouchState const & in_state);
3333  virtual bool OnTouchUp(TouchState const & in_state);
3338  virtual bool OnTouchMove(TouchState const & in_state);
3339 
3340  virtual void OnViewAttached();
3341  virtual void OnViewDetached();
3342 
3343  virtual void OnModelAttached();
3344 
3345  void UpdateHighlightColor();
3346 
3351  void SetReferenceSegment(HPS::KeyPath const & in_path_to_segment);
3352 
3357  void SetReferenceSegment(HPS::KeyPathArray const & in_path_to_segments);
3358 
3362  HPS::KeyPathArray ShowReferenceSegment();
3363 
3364 private:
3365  void Transition(HPS::SelectionResults const & selection_results);
3366  bool Orbit(HPS::WindowPoint const & in_loc);
3367  void TranslatePoint(HPS::WindowPoint * point);
3368  bool IsEventRelevant(HPS::Point const & event_location, HPS::KeyPath const & event_path);
3369  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
3370 
3371  bool operator_active;
3372  HPS::TouchID tracked_touch_ID;
3373  HPS::WindowPoint start_point;
3374  HPS::WindowPoint down_position;
3375  HPS::Vector start_sphere_point;
3376  HPS::KeyPathArray reference_segments; //rotation and zooming happen around these segments
3377 
3378  HPS::SegmentKey nav_cube_segment;
3379  HPS::SegmentKey style_segment;
3380  HPS::PortfolioKey portfolio;
3381  HPS::ReferenceKeyArrayArray groups;
3382  HPS::HighlightOptionsKit highlight_options_kit;
3383  HPS::CameraKit previous_camera;
3384  int previous_face;
3385  bool suppress_mouse_over_highlights;
3386 
3387  HPS::Rectangle nav_cube_subwindow;
3388  HPS::IntRectangle nav_cube_subwindow_offsets;
3389  float nav_cube_subwindow_width;
3390  float nav_cube_subwindow_height;
3391 
3392  int highlighted_group;
3393 
3394  bool moving;
3395 
3396  class SmoothTransitionCompleteEventHandler : public EventHandler
3397  {
3398  public:
3399  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
3400  : handler_view(in_view), handler_moving(&in_moving) {}
3401 
3402  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
3403 
3404  virtual HandleResult Handle(HPS::Event const * in_event);
3405 
3406  private:
3407  View handler_view;
3408  bool * handler_moving;
3409  };
3410 
3411  SmoothTransitionCompleteEventHandler * handler;
3412 };
3413 
3414 
3415 
3416 
3417 class SceneTreeItem;
3418 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3419 class SceneTree;
3420 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3421 
3424 class SPRK_API SceneTree : public Sprocket
3425 {
3426 public:
3429  enum class ItemType : uint32_t
3430  {
3431  None = 0x00000000,
3432  GenericMask = 0xffff0000,
3433 
3434  Segment = 0x00000001,
3435  Include = 0x00000002,
3436  ConditionalExpression = 0x00000003,
3437  StaticModelSegment = 0x00000004,
3438  AttributeFilter = 0x00000005,
3439 
3440  Geometry = 0x00010000,
3441  CuttingSection = 0x00010001,
3442  Shell = 0x00010002,
3443  Mesh = 0x00010003,
3444  Grid = 0x00010004,
3445  NURBSSurface = 0x00010005,
3446  Cylinder = 0x00010006,
3447  Sphere = 0x00010007,
3448  Polygon = 0x00010008,
3449  Circle = 0x00010009,
3450  CircularWedge = 0x0001000a,
3451  Ellipse = 0x0001000b,
3452  Line = 0x0001000c,
3453  NURBSCurve = 0x0001000d,
3454  CircularArc = 0x0001000e,
3455  EllipticalArc = 0x0001000f,
3456  InfiniteLine = 0x00010010,
3457  InfiniteRay = 0x00010011,
3458  Marker = 0x00010012,
3459  Text = 0x00010013,
3460  Reference = 0x00010014,
3461  DistantLight = 0x00010015,
3462  Spotlight = 0x00010016,
3463 
3464  Attribute = 0x00020000,
3465  Portfolio = 0x00020001,
3466  SegmentStyle = 0x00020002,
3467  NamedStyle = 0x00020003,
3468  MaterialPalette = 0x00020004,
3469  Priority = 0x00020005,
3470  Material = 0x00020006,
3471  Camera = 0x00020007,
3472  ModellingMatrix = 0x00020008,
3473  UserData = 0x00020009,
3474  TextureMatrix = 0x0002000a,
3475  Culling = 0x0002000b,
3476  CurveAttribute = 0x0002000c,
3477  CylinderAttribute = 0x0002000d,
3478  EdgeAttribute = 0x0002000e,
3479  LightingAttribute = 0x0002000f,
3480  LineAttribute = 0x00020010,
3481  MarkerAttribute = 0x00020011,
3482  SurfaceAttribute = 0x00020012,
3483  Selectability = 0x00020013,
3484  SphereAttribute = 0x00020014,
3485  Subwindow = 0x00020015,
3486  TextAttribute = 0x00020016,
3487  Transparency = 0x00020017,
3488  Visibility = 0x00020018,
3489  VisualEffects = 0x00020019,
3490  Performance = 0x00020020,
3491  DrawingAttribute = 0x00020021,
3492  HiddenLineAttribute = 0x00020022,
3493  ContourLine = 0x00020023,
3494  Condition = 0x00020024,
3495  Bounding = 0x00020025,
3496  AttributeLock = 0x00020026,
3497  TransformMask = 0x00020027,
3498  ColorInterpolation = 0x00020028,
3499  CuttingSectionAttribute = 0x00020029,
3500 
3501  // window only attributes
3502  Debugging = 0x00020030,
3503  PostProcessEffects = 0x00020031,
3504  SelectionOptions = 0x00020032,
3505  UpdateOptions = 0x00020033,
3506 
3507  Definition = 0x00040000,
3508  NamedStyleDefinition = 0x00040001,
3509  TextureDefinition = 0x00040002,
3510  LinePatternDefinition = 0x00040003,
3511  GlyphDefinition = 0x00040004,
3512  CubeMapDefinition = 0x00040005,
3513  ImageDefinition = 0x00040006,
3514  MaterialPaletteDefinition = 0x00040007,
3515  ShaderDefinition = 0x00040008,
3516  ShapeDefinition = 0x00040009,
3517 
3518  Group = 0x00080000,
3519  SegmentGroup = 0x00080100,
3520  GeometryGroup = 0x00080200,
3521  AttributeGroup = 0x00080300,
3522  PortfolioGroup = 0x00080400,
3523  StyleGroup = 0x00080500,
3524  IncludeGroup = 0x00080600,
3525  DefinitionGroup = 0x00180000,
3526  NamedStyleDefinitionGroup = 0x00180700,
3527  TextureDefinitionGroup = 0x00180800,
3528  LinePatternDefinitionGroup = 0x00180900,
3529  GlyphDefinitionGroup = 0x00180a00,
3530  CubeMapDefinitionGroup = 0x00180b00,
3531  ImageDefinitionGroup = 0x00180c00,
3532  MaterialPaletteDefinitionGroup = 0x00180d00,
3533  ShaderDefinitionGroup = 0x00180e00,
3534  ShapeDefinitionGroup = 0x00180f00,
3535  GeometryGroupMask = 0x00280000,
3536  CuttingSectionGroup = 0x00280001,
3537  ShellGroup = 0x00280002,
3538  MeshGroup = 0x00280003,
3539  GridGroup = 0x00280004,
3540  NURBSSurfaceGroup = 0x00280005,
3541  CylinderGroup = 0x00280006,
3542  SphereGroup = 0x00280007,
3543  PolygonGroup = 0x00280008,
3544  CircleGroup = 0x00280009,
3545  CircularWedgeGroup = 0x0028000a,
3546  EllipseGroup = 0x0028000b,
3547  LineGroup = 0x0028000c,
3548  NURBSCurveGroup = 0x0028000d,
3549  CircularArcGroup = 0x0028000e,
3550  EllipticalArcGroup = 0x0028000f,
3551  InfiniteLineGroup = 0x00280010,
3552  InfiniteRayGroup = 0x00280011,
3553  MarkerGroup = 0x00280012,
3554  TextGroup = 0x00280013,
3555  ReferenceGroup = 0x00280014,
3556  DistantLightGroup = 0x00280015,
3557  SpotlightGroup = 0x00280016,
3558  };
3559 
3561  SceneTree();
3562 
3565  SceneTree(Canvas const & in_canvas);
3566 
3569  SceneTree(SceneTree const & in_that);
3570 
3573  SceneTree(SceneTree && in_that);
3574 
3575  virtual ~SceneTree();
3576 
3577  static const HPS::Type staticType = HPS::Type::SceneTree;
3578  virtual HPS::Type ObjectType() const { return staticType; }
3579 
3583  SceneTree & operator=(SceneTree const & in_that);
3584 
3588  SceneTree & operator=(SceneTree && in_that);
3589 
3593  virtual void Assign(SceneTree const & in_that);
3594 
3598  bool Equals(SceneTree const & in_that) const;
3599 
3603  bool operator!=(SceneTree const & in_that) const;
3604 
3608  bool operator==(SceneTree const & in_that) const;
3609 
3610 
3619  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3620 
3630  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
3631 
3642  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
3643 
3651  void AddHighlightOptions(HighlightOptionsKit const & in_options);
3652 
3655  HighlightOptionsKitArray GetHighlightOptions() const;
3656 
3657 
3662  void SetGroupingLimit(size_t in_limit);
3663 
3666  size_t GetGroupingLimit() const;
3667 
3668 
3675  void SetRoot(SceneTreeItemPtr const & in_root);
3676 
3679  SceneTreeItemPtr GetRoot() const;
3680 
3681 
3684  virtual void Flush();
3685 
3690  void SetHighlightEventHandling(bool in_state);
3691 
3695  bool GetHighlightEventHandling() const;
3696 
3699  void ReExpand();
3700 };
3701 
3702 
3705 class SPRK_API SceneTreeItem : public Sprocket
3706 {
3707 public:
3709  SceneTreeItem();
3710 
3713  SceneTreeItem(SceneTreeItem const & in_that);
3714 
3717  SceneTreeItem(SceneTreeItem && in_that);
3718 
3724  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3725 
3731  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3732 
3738  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3739 
3745  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3746 
3754  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3755 
3756  virtual ~SceneTreeItem();
3757 
3758  static const HPS::Type staticType = HPS::Type::SceneTreeItem;
3759  HPS::Type ObjectType() const { return staticType; }
3760 
3764  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3765 
3769  SceneTreeItem & operator=(SceneTreeItem && in_that);
3770 
3774  virtual void Assign(SceneTreeItem const & in_that);
3775 
3779  bool Equals(SceneTreeItem const & in_that) const;
3780 
3784  bool operator!=(SceneTreeItem const & in_that) const;
3785 
3789  bool operator==(SceneTreeItem const & in_that) const;
3790 
3791 
3794  SceneTreePtr GetTree() const;
3795 
3798  UTF8 GetTitle() const;
3799 
3802  SceneTree::ItemType GetItemType() const;
3803 
3807  bool HasItemType(SceneTree::ItemType in_mask) const;
3808 
3811  Key GetKey() const;
3812 
3815  KeyPath GetKeyPath() const;
3816 
3819  bool HasChildren() const;
3820 
3821 
3830  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3831 
3832 
3835  virtual void Expand();
3836 
3839  virtual void Collapse();
3840 
3841 
3846  bool IsSelected() const;
3847 
3853  virtual void Select();
3854 
3860  virtual void Unselect();
3861 
3866  bool IsHighlightable() const;
3867 
3873  bool IsHighlighted() const;
3874 
3879  void Highlight(size_t in_highlight_options_index = 0);
3880 
3886  void Highlight(HighlightOptionsKit const & in_highlight_options);
3887 
3893  void Unhighlight(size_t in_highlight_options_index = 0);
3894 
3901  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
3902 
3905  bool IsExpanded() const;
3906 
3909  void ReExpand();
3910 };
3911 
3912 
3913 
3914 class ComponentTreeItem;
3915 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3916 class ComponentTree;
3917 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3918 
3921 class SPRK_API ComponentTree : public Sprocket
3922 {
3923 public:
3926  enum class ItemType
3927  {
3928  None,
3929  ExchangeComponent,
3930  ExchangeModelFile,
3931 
3932  ExchangeViewGroup,
3933  ExchangeAnnotationViewGroup,
3934  ExchangePMIGroup,
3935  ExchangeModelGroup,
3936 
3937  ParasolidComponent,
3938  ParasolidModelFile,
3939 
3940  DWGComponent,
3941  DWGModelFile,
3942  };
3943 
3945  ComponentTree();
3946 
3950  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3951 
3954  ComponentTree(ComponentTree const & in_that);
3955 
3958  ComponentTree(ComponentTree && in_that);
3959 
3960  virtual ~ComponentTree();
3961 
3962  static const HPS::Type staticType = HPS::Type::ComponentTree;
3963  virtual HPS::Type ObjectType() const { return staticType; }
3964 
3968  ComponentTree & operator=(ComponentTree const & in_that);
3969 
3973  ComponentTree & operator=(ComponentTree && in_that);
3974 
3978  virtual void Assign(ComponentTree const & in_that);
3979 
3983  bool Equals(ComponentTree const & in_that) const;
3984 
3988  bool operator!=(ComponentTree const & in_that) const;
3989 
3993  bool operator==(ComponentTree const & in_that) const;
3994 
3995 
4004  void SetHighlightOptions(HighlightOptionsKit const & in_options);
4005 
4015  void SetHighlightOptions(HighlightOptionsKitArray const & in_options);
4016 
4027  void SetHighlightOptions(size_t in_count, HighlightOptionsKit const in_options []);
4028 
4038  void AddHighlightOptions(HighlightOptionsKit const & in_options);
4039 
4042  HighlightOptionsKitArray GetHighlightOptions() const;
4043 
4044 
4051  void SetRoot(ComponentTreeItemPtr const & in_root);
4052 
4055  ComponentTreeItemPtr GetRoot() const;
4056 
4057 
4060  virtual void Flush();
4061 
4064  void ReExpand();
4065 
4070  void SetHighlightEventHandling(bool in_state);
4071 
4075  bool GetHighlightEventHandling() const;
4076 };
4077 
4078 
4081 class SPRK_API ComponentTreeItem : public Sprocket
4082 {
4083 public:
4086 
4089  ComponentTreeItem(ComponentTreeItem const & in_that);
4090 
4094 
4100  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
4101 
4108  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
4109 
4110  virtual ~ComponentTreeItem();
4111 
4112  static const HPS::Type staticType = HPS::Type::ComponentTreeItem;
4113  HPS::Type ObjectType() const { return staticType; }
4114 
4118  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
4119 
4123  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
4124 
4128  virtual void Assign(ComponentTreeItem const & in_that);
4129 
4133  bool Equals(ComponentTreeItem const & in_that) const;
4134 
4138  bool operator!=(ComponentTreeItem const & in_that) const;
4139 
4143  bool operator==(ComponentTreeItem const & in_that) const;
4144 
4145 
4146 
4149  ComponentTreePtr GetTree() const;
4150 
4153  UTF8 GetTitle() const;
4154 
4157  ComponentTree::ItemType GetItemType() const;
4158 
4161  Component GetComponent() const;
4162 
4165  bool HasChildren() const;
4166 
4169  ComponentPath GetPath() const;
4170 
4171 
4179  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
4180 
4181 
4184  virtual void Expand();
4185 
4188  virtual void Collapse();
4189 
4190 
4198  bool IsHighlighted() const;
4199 
4204  virtual void OnHighlight(HighlightOptionsKit const & in_options);
4205 
4210  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
4211 
4212 
4217  void Highlight(size_t in_highlight_options_index = 0);
4218 
4224  void Highlight(HighlightOptionsKit const & in_highlight_options);
4225 
4230  void Unhighlight(size_t in_highlight_options_index = 0);
4231 
4237  void Unhighlight(HighlightOptionsKit const & in_highlight_options);
4238 
4239 
4251  bool IsHidden() const;
4252 
4256  virtual void OnHide();
4257 
4261  virtual void OnShow();
4262 
4267  void Hide();
4268 
4274  void Show(Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
4275 
4281  void Isolate(Component::Visibility in_subtree_visibility = Component::Visibility::PreserveNone);
4282 
4285  bool IsExpanded() const;
4286 
4289  void ReExpand();
4290 };
4291 
4292 
4293 
4294 
4295 }
4296 #endif
4297 
4298 
4299 
Definition: sprk.h:2996
Definition: hps.h:3390
Definition: hps.h:6208
Definition: sprk.h:1002
Event * Clone() const
Definition: sprk.h:755
Definition: sprk.h:3175
Definition: sprk.h:267
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2417
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1201
Definition: hps.h:42280
ComponentHighlightEvent()
Definition: sprk.h:2399
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1227
Definition: hps.h:470
CameraChangedEvent(Event const &in_event)
Definition: sprk.h:1021
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1186
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5823
Location
Definition: sprk.h:1458
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1230
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1191
ItemType
Definition: sprk.h:3926
Definition: hps.h:5863
virtual intptr_t Freshen() const
Definition: sprk.h:1044
CaptureActivationEvent()
Definition: sprk.h:2592
Definition: sprk.h:66
Definition: sprk.h:208
ComponentIsolateEvent(Event const &in_event)
Definition: sprk.h:2360
Definition: sprk.h:677
Definition: sprk.h:100
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1151
Definition: sprk.h:4081
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1161
Definition: sprk.h:3050
Definition: hps.h:42063
ComponentIsolateEvent()
Definition: sprk.h:2343
Definition: hps.h:1338
Definition: hps.h:1056
Definition: hps.h:1732
Visibility
Definition: sprk.h:1745
Definition: sprk.h:236
ModelDeletedEvent()
Definition: sprk.h:963
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:3246
std::vector< KeyPath, Allocator< KeyPath > > KeyPathArray
Array of type HPS::KeyPath.
Definition: hps.h:6674
Definition: sprk.h:3921
Definition: hps.h:47626
Definition: sprk.h:1062
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1176
Definition: hps.h:7714
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1222
Definition: hps.h:3541
Definition: hps.h:2098
Definition: sprk.h:914
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:799
Definition: sprk.h:2338
Definition: sprk.h:765
Definition: hps.h:1421
Definition: hps.h:877
Definition: hps.h:42183
virtual void OnModelDetached()
Definition: sprk.h:1215
SmoothTransitionCompleteEvent(Event const &in_event)
Definition: sprk.h:3251
Definition: hps.h:1790
Definition: hps.h:1556
Definition: hps.h:8941
Definition: hps.h:244
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1218
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1850
Event * Clone() const
Definition: sprk.h:905
CameraChangedEvent()
Definition: sprk.h:1006
SprocketKit & operator=(SprocketKit &&in_that)
Definition: sprk.h:257
Definition: hps.h:47524
Definition: hps.h:41116
Definition: sprk.h:1454
Definition: sprk.h:959
Definition: sprk.h:561
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:841
virtual void OnViewDetached()
Definition: sprk.h:1207
Definition: hps.h:41163
LayoutDeletedEvent()
Definition: sprk.h:769
Event * Clone() const
Definition: sprk.h:949
virtual void OnViewAttached()
Definition: sprk.h:1204
Definition: hps.h:40548
Definition: hps.h:43779
Definition: hps.h:1096
Definition: sprk.h:2735
LayoutDetachedEvent()
Definition: sprk.h:724
Definition: sprk.h:2849
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1166
Definition: hps.h:9772
Definition: hps.h:42227
Definition: hps.h:1509
SmoothTransitionCompleteEvent()
Definition: sprk.h:3241
Definition: hps.h:1441
Event * Clone() const
Definition: sprk.h:2376
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1146
FilterActivationEvent()
Definition: sprk.h:2503
Definition: hps.h:1460
virtual void OnModelAttached()
Definition: sprk.h:1211
Definition: hps.h:38298
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2517
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:933
Definition: hps.h:7085
Location
Definition: sprk.h:1605
Definition: hps.h:46995
Definition: sprk.h:2800
Definition: sprk.h:1601
Definition: hps.h:43958
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:229
Definition: hps.h:45890
virtual UTF8 GetName() const
Definition: sprk.h:1136
Definition: hps.h:47411
Definition: sprk.h:720
Event * Clone() const
Definition: sprk.h:2534
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2606
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1171
CanvasDeletedEvent()
Definition: sprk.h:681
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1156
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:224
Event * Clone() const
Definition: sprk.h:2622
Definition: hps.h:15474
ViewDeletedEvent()
Definition: sprk.h:875
intptr_t GetChannel() const
Definition: hps.h:6325
Definition: sprk.h:808
SprocketKit(SprocketKit &&in_that)
Definition: sprk.h:252
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:3273
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3180
Definition: sprk.h:1739
Definition: hps.h:44237
Definition: hps.h:46502
virtual bool OnTextInput(HPS::UTF8 const &in_text)
Definition: sprk.h:1196
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:890
Definition: hps.h:37859
Definition: sprk.h:2947
ViewDetachedEvent()
Definition: sprk.h:819
Definition: hps.h:6292
Override the visibility for any components in the subtree under the ComponentPath specified regardles...
Definition: sprk.h:1305
Definition: hps.h:406
Event * Clone() const
Definition: sprk.h:2434
Definition: sprk.h:481
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:696
Definition: sprk.h:3300
Definition: sprk.h:2065
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:1034
ComponentType
Definition: sprk.h:1755
Definition: hps.h:45815
std::vector< Key, Allocator< Key > > KeyArray
Array of type HPS::Key.
Definition: hps.h:6646
Definition: hps.h:2117
Definition: sprk.h:2388
Event * Clone() const
Definition: sprk.h:711
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:739
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1141
ItemType
Definition: sprk.h:3429
Definition: sprk.h:2447
Definition: sprk.h:3101
virtual HPS::UTF8 GetName() const
Definition: sprk.h:3307
Definition: sprk.h:185
Definition: sprk.h:3237
Definition: hps.h:425
Event * Clone() const
Definition: sprk.h:993
Definition: sprk.h:2547
Definition: hps.h:2137
ModelDetachedEvent()
Definition: sprk.h:918
static MouseButtons ButtonLeft()
Definition: hps.h:47113
Definition: sprk.h:3424
Definition: sprk.h:2898
UpdateType
Definition: hps.h:178
Definition: hps.h:9099
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1233
Definition: hps.h:7632
Definition: sprk.h:2492
Definition: hps.h:37472
Definition: hps.h:351
Event * Clone() const
Definition: sprk.h:3264
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:978
Event * Clone() const
Definition: sprk.h:859
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:784
Definition: hps.h:9328
Definition: hps.h:10877
Definition: sprk.h:1248
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1181
Definition: sprk.h:3705
Definition: sprk.h:2634
Definition: hps.h:42759
Mode
Definition: sprk.h:190
Definition: hps.h:511
Definition: sprk.h:1104
Definition: hps.h:1139
Definition: hps.h:42109
Definition: sprk.h:871
Definition: sprk.h:2588
Definition: hps.h:40612
Definition: hps.h:7343
Event * Clone() const
Definition: sprk.h:1051