sprk.h
1 // Copyright (c) 1998-2014 by 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 <list>
16 #include <stack>
17 #include <memory>
18 #include <map>
19 
20 #ifdef _MSC_VER
21 # pragma warning(disable: 4251) //Not an issue as long as debug and release libraries aren't mixed
22 #ifndef STATIC_APP
23 # ifdef SPROCKETS
24 # define SPRK_API __declspec (dllexport)
25 # else
26 # define SPRK_API __declspec (dllimport)
27 # endif
28 #endif
29 #else
30 # include <stddef.h>
31 # if defined(LINUX_SYSTEM) && defined(SPROCKETS)
32 # ifndef STATIC_APP
33 # define SPRK_API __attribute__ ((visibility ("default")))
34 # endif
35 # endif
36 #endif
37 
38 #ifndef SPRK_API
39 # define SPRK_API
40 #endif
41 namespace SPRKI
42 {
43  class X;
44 };
45 
46 namespace HPS
47 {
48 
49 class Factory;
50 class Canvas;
51 class Layout;
52 class View;
53 class Model;
54 class Operator;
55 class OperatorControl;
56 class NavigationCubeControl;
57 class AxisTriadControl;
58 class Component;
59 class ComponentPath;
60 class ComponentHighlightEvent;
61 class Filter;
62 class Capture;
63 class CADModel;
64 class Metadata;
65 
66 
67 
68 
69 class SPRK_API Sprocket : public HPS::Object
70 {
71 public:
72  Sprocket() {}
73  Sprocket(Sprocket && in_that) : HPS::Object(std::move(in_that)) {}
74 
75  virtual ~Sprocket() {}
76 
77  enum class UpdateType
78  {
79  Synchronous,
80  Asynchronous
81  };
82 };
83 
84 typedef std::shared_ptr<Operator> OperatorPtr;
85 
86 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
87 
88 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
89 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
90 typedef std::vector<View, Allocator<View> > ViewArray;
91 typedef std::vector<Model, Allocator<Model> > ModelArray;
92 
93 typedef std::vector<Component, Allocator<Component> > ComponentArray;
94 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
95 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
96 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
97 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
98 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
99 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
100 
101 
105 class SPRK_API Canvas : public Sprocket
106 {
107 public:
108  Canvas();
109  Canvas(Canvas const & that);
110  ~Canvas();
111 
112  HPS::Type ObjectType() const { return HPS::Type::Canvas; }
113 
115  void Delete();
116 
117  Canvas & operator=(Canvas const & in_that);
118  void Assign(Canvas const & in_that);
119 
120  bool Equals(Canvas const & in_that) const;
121  bool operator!= (Canvas const & in_that) const;
122  bool operator== (Canvas const & in_that) const;
123 
125  UTF8 GetName() const;
126 
130  void AttachLayout(Layout const & in_layout);
131 
135  void AttachViewAsLayout(View const & in_view);
136 
138  void DetachLayout();
139 
141  Layout GetAttachedLayout() const;
142 
144  IncludeKey GetAttachedLayoutIncludeLink() const;
145 
147  View GetFrontView() const;
148 
149  WindowKey const GetWindowKey() const;
150 
153  WindowKey GetWindowKey();
154 
155  PortfolioKey const GetPortfolioKey() const;
156 
158  PortfolioKey GetPortfolioKey();
159 
161  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
162 
165  UpdateNotifier UpdateWithNotifier() const;
166 
170  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit = -1.) const;
171 
176  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit = -1.) const;
177 
181  void SetFrameRate(float in_frame_rate=20);
182 
186  float GetFrameRate() const;
187 };
188 
189 class SPRK_API Rendering
190 {
191 public:
194  enum class Mode
195  {
196  Gouraud,
197  GouraudWithLines,
198  Flat,
199  FlatWithLines,
200  Phong,
201  PhongWithLines,
202  HiddenLine,
203  FastHiddenLine,
204  Wireframe,
205  Default = Phong
206  };
207 
208 private:
209  Rendering() {}
210 };
211 
212 class SPRK_API SprocketControl : public Sprocket
213 {
214 public:
215  HPS::Type ObjectType() const {return HPS::Type::SprocketControl;}
216 
217 protected:
218  SprocketControl() {}
219 
223  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
224 
229  {
230  this->Object::operator=(std::move(in_that));
231  return *this;
232  }
233 };
234 
238 class SPRK_API View : public Sprocket
239 {
240 public:
241  View();
242  View(View const & that);
243  explicit View(SprocketControl const & in_ctrl);
244  ~View();
245 
246  HPS::Type ObjectType() const { return HPS::Type::View; }
247 
249  void Delete();
250 
251  View & operator=(View const & in_that);
252  void Assign(View const & in_that);
253 
254  bool Equals(View const & in_that) const;
255  bool operator!= (View const & in_that) const;
256  bool operator== (View const & in_that) const;
257 
259  UTF8 GetName() const;
260 
261 
263  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
264 
267  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
268 
269 
272  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
273 
278  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
279 
280 
285  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
286 
287 
289  HPS::View & FitWorld();
290 
293  HPS::View & FitWorld(SegmentKey const & in_segment);
294 
295 
298  HPS::View & FitWorld(BoundingKit const & in_bounding);
299 
304  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
305 
306 
311  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
312 
317  void AttachModel(Model const & in_model);
318 
320  void DetachModel();
321 
323  Model GetAttachedModel() const;
324 
326  IncludeKey GetAttachedModelIncludeLink() const;
327 
331  void SetRenderingMode(Rendering::Mode in_mode);
332 
335  Rendering::Mode GetRenderingMode() const;
336 
338  OperatorPtrArray GetOperators() const;
339 
342  void SetOperators(OperatorPtrArray & in_operators);
343 
347  void SetOperators(size_t in_count, OperatorPtr in_operators []);
348 
351  void SetOperator(OperatorPtr const & in_operator);
352 
355  void SetOperator(Operator * in_operator);
356 
358  OperatorControl GetOperatorControl();
359  OperatorControl const GetOperatorControl() const;
360 
362  NavigationCubeControl GetNavigationCubeControl();
363  NavigationCubeControl const GetNavigationCubeControl() const;
364 
366  AxisTriadControl GetAxisTriadControl();
367  AxisTriadControl const GetAxisTriadControl() const;
368 
371  SegmentKey GetSegmentKey();
372  SegmentKey const GetSegmentKey() const;
373 
376  SegmentKey GetModelOverrideSegmentKey();
377  SegmentKey const GetModelOverrideSegmentKey() const;
378 
379 
380  PortfolioKey const GetPortfolioKey() const;
381 
383  PortfolioKey GetPortfolioKey();
384 
389  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
390 
391  /* Returns the status of the simple shadows */
392  bool GetSimpleShadow();
393 
398  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
399 
400  /* Returns the status of the simple reflection */
401  bool GetSimpleReflection();
402 
404  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
405 
409  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
410 
411  /* Smoothly moves the camera from the current position to the one specified by the user.
412  \param in_camera_kit a camera kit describing the destination camera
413  \param in_duration the duration of the animation, specified in seconds. Defaults to 0.5 seconds. */
414  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
415 
416  static UTF8 GetHideStyleName();
417  static UTF8 GetShowStyleName();
418 
420  KeyArray const GetNavigationKeys();
421 
423  LayoutArray GetOwningLayouts();
424  LayoutArray const GetOwningLayouts() const;
425 };
426 
430 class SPRK_API Model : public Sprocket
431 {
432 public:
433  Model();
434  Model(Model const & that);
435  ~Model();
436 
437  HPS::Type ObjectType() const { return HPS::Type::Model; }
438 
440  void Delete();
441 
442  Model & operator=(Model const & in_that);
443  void Assign(Model const & in_that);
444 
445  bool Equals(Model const & in_that) const;
446  bool operator!= (Model const & in_that) const;
447  bool operator== (Model const & in_that) const;
448 
450  UTF8 GetName() const;
451 
454  SegmentKey GetSegmentKey();
455  SegmentKey const GetSegmentKey() const;
456 
458  SegmentKey GetLibraryKey();
459  SegmentKey const GetLibraryKey() const;
460 
462  PortfolioKey GetPortfolioKey();
463  PortfolioKey const GetPortfolioKey() const;
464 
466  HPS::Vector GetUpVector();
467  HPS::Vector const GetUpVector() const;
468 
470  HPS::Vector GetFrontVector();
471  HPS::Vector const GetFrontVector() const;
472 
474  HPS::ViewArray GetOwningViews();
475  HPS::ViewArray const GetOwningViews() const;
476 
480  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
481 
483  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector);
484 
486  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
487 
491  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
492 };
493 
497 class SPRK_API Layout : public Sprocket
498 {
499 public:
500  Layout();
501  Layout(Layout const & that);
502  ~Layout();
503 
504  HPS::Type ObjectType() const { return HPS::Type::Layout; }
505 
507  void Delete();
508 
509  Layout & operator=(Layout const & in_that);
510  void Assign(Layout const & in_that);
511 
512  bool Equals(Layout const & in_that) const;
513  bool operator!= (Layout const & in_that) const;
514  bool operator== (Layout const & in_that) const;
515 
517  UTF8 GetName() const;
518 
519  /* Returns the number of Layers currently associated with this Layout */
520  size_t GetLayerCount() const;
521 
525  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
529  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
530 
533  void DetachLayer(size_t in_layer);
534 
537  void DetachView(View const & in_view); // everywhere it occurs
538 
541  void BringToFront(size_t in_layer);
542 
546  void ReassignLayer(size_t in_layer, HPS::View in_view);
547 
551  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
552 
554  View GetFrontView() const;
555 
559  View GetAttachedView(size_t in_layer = 0) const;
560 
564  Rectangle GetPosition(size_t in_layer) const;
565 
567  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
568 
570  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
571 
572  /* Returns the position within the layer list of the top layer at a specified position
573  * \param in_point A point in Window coordinates.
574  * \return The position within the layer list of the top layer at position in_point. */
575  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
576 
577  /* Returns whether a layer is present at the specified position.
578  * \param in_point A point in Window coordinates.
579  * \return <span class='code'>true</span> if a layer is present at in_point, <span class='code'>false</span> otherwise. */
580  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
581 
584  SegmentKey GetSegmentKey();
585  SegmentKey const GetSegmentKey() const;
586 
588  CanvasArray GetOwningCanvases();
589  CanvasArray const GetOwningCanvases() const;
590 
592  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
593 
597  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
598 };
599 
600 class SPRK_API CanvasDeletedEvent : public Event
601 {
602 public:
605  {
606  channel = GetClassID();
607  consumable = false;
608  }
609 
610  CanvasDeletedEvent(Canvas const & in_canvas)
611  : Event(), canvas(in_canvas)
612  {
613  channel = GetClassID();
614  consumable = false;
615  }
616 
619  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
620  {
621  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
622  {
623  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
624  canvas = that.canvas;
625  }
626  else
627  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
628  }
629 
631 
634  Event * Clone() const
635  {
636  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
637  return new_event;
638  }
639 
640  Canvas canvas;
641 };
642 
643 class SPRK_API LayoutDetachedEvent : public Event
644 {
645 public:
648  {
649  channel = GetClassID();
650  consumable = false;
651  }
652 
653  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
654  : Event(), canvas(in_canvas), layout(in_layout)
655  {
656  channel = GetClassID();
657  consumable = false;
658  }
659 
662  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
663  {
664  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
665  {
666  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
667  canvas = that.canvas;
668  layout = that.layout;
669  }
670  else
671  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
672  }
673 
675 
678  Event * Clone() const
679  {
680  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
681  return new_event;
682  }
683 
684  Canvas canvas;
685  Layout layout;
686 };
687 
688 class SPRK_API LayoutDeletedEvent : public Event
689 {
690 public:
693  {
694  channel = GetClassID();
695  consumable = false;
696  }
697 
698  LayoutDeletedEvent(Layout const & in_layout)
699  : Event(), layout(in_layout)
700  {
701  channel = GetClassID();
702  consumable = false;
703  }
704 
707  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
708  {
709  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
710  {
711  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
712  layout = that.layout;
713  }
714  else
715  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
716  }
717 
719 
722  Event * Clone() const
723  {
724  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
725  return new_event;
726  }
727 
728  Layout layout;
729 };
730 
731 class SPRK_API ViewDetachedEvent : public Event
732 {
733 public:
734  enum class Action
735  {
736  None = 0,
737  SpecificLayer,
738  AllLayers,
739  };
740 
742  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
743  {
744  channel = GetClassID();
745  consumable = false;
746  }
747 
748  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
749  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
750  {
751  channel = GetClassID();
752  consumable = false;
753  }
754 
755  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
756  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
757  {
758  channel = GetClassID();
759  consumable = false;
760  }
761 
764  ViewDetachedEvent(Event const & in_event) : Event(in_event)
765  {
766  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
767  {
768  auto that = static_cast<ViewDetachedEvent const &>(in_event);
769  layout = that.layout;
770  action = that.action;
771  layer = that.layer;
772  view = that.view;
773  }
774  else
775  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
776  }
777 
779 
782  Event * Clone() const
783  {
784  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
785  return new_event;
786  }
787 
788  Layout layout;
789  Action action;
790  size_t layer;
791  View view;
792 };
793 
794 class SPRK_API ViewDeletedEvent : public Event
795 {
796 public:
799  {
800  channel = GetClassID();
801  consumable = false;
802  }
803 
804  ViewDeletedEvent(View const & in_view)
805  : Event(), view(in_view)
806  {
807  channel = GetClassID();
808  consumable = false;
809  }
810 
813  ViewDeletedEvent(Event const & in_event) : Event(in_event)
814  {
815  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
816  {
817  auto that = static_cast<ViewDeletedEvent const &>(in_event);
818  view = that.view;
819  }
820  else
821  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
822  }
823 
824  ~ViewDeletedEvent();
825 
828  Event * Clone() const
829  {
830  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
831  return new_event;
832  }
833 
834  View view;
835 };
836 
837 class SPRK_API ModelDetachedEvent : public Event
838 {
839 public:
842  {
843  channel = GetClassID();
844  consumable = false;
845  }
846 
847  ModelDetachedEvent(View const & in_view, Model const & in_model)
848  : Event(), view(in_view), model(in_model)
849  {
850  channel = GetClassID();
851  consumable = false;
852  }
853 
856  ModelDetachedEvent(Event const & in_event) : Event(in_event)
857  {
858  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
859  {
860  auto that = static_cast<ModelDetachedEvent const &>(in_event);
861  view = that.view;
862  model = that.model;
863  }
864  else
865  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
866  }
867 
869 
872  Event * Clone() const
873  {
874  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
875  return new_event;
876  }
877 
878  View view;
879  Model model;
880 };
881 
882 class SPRK_API ModelDeletedEvent : public Event
883 {
884 public:
887  {
888  channel = GetClassID();
889  consumable = false;
890  }
891 
892  ModelDeletedEvent(Model const & in_model)
893  : Event(), model(in_model)
894  {
895  channel = GetClassID();
896  consumable = false;
897  }
898 
901  ModelDeletedEvent(Event const & in_event) : Event(in_event)
902  {
903  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
904  {
905  auto that = static_cast<ModelDeletedEvent const &>(in_event);
906  model = that.model;
907  }
908  else
909  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
910  }
911 
913 
916  Event * Clone() const
917  {
918  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
919  return new_event;
920  }
921 
922  Model model;
923 };
924 
925 /* The SprocketPath class is a utility class which can be used to automatically obtain a KeyPath
926  * from the Model to the Canvas. */
927 class SPRK_API SprocketPath : public Sprocket
928 {
929 public:
930  SprocketPath();
931  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
932  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
933  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
934  SprocketPath(SprocketPath const & that);
935  ~SprocketPath();
936 
937  HPS::Type ObjectType() const { return HPS::Type::SprocketPath; }
938 
939  SprocketPath & operator=(SprocketPath const & in_that);
940  void Set(SprocketPath const & in_that);
941 
942  bool Equals(SprocketPath const & in_that) const;
943  bool operator!= (SprocketPath const & in_that) const;
944  bool operator== (SprocketPath const & in_that) const;
945 
947  Canvas GetCanvas() const;
948 
950  Layout GetLayout() const;
951 
953  View GetView() const;
954 
956  Model GetModel() const;
957 
962  KeyPath GetKeyPath() const;
963 };
964 
965 
968 class SPRK_API Operator : public Sprocket
969 {
970 public:
971  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
972  Operator(Operator const & in_that);
973 
974  virtual ~Operator();
975 
976  HPS::Type ObjectType() const { return HPS::Type::Operator; }
977 
978  virtual Operator & operator= (Operator const & in_that);
979 
980  /* Assigns the parameter in_that to this operator, resulting in a clone. */
981  virtual void Assign(Operator const & in_that);
982 
983  /* Tests this operator for equality against the parameter <span class=code>in_that</span>. Same as Operator::operator== */
984  virtual bool Equals(Operator const & in_that) const;
985 
986  /* Tests this operator for non-equality against the parameter <span class=code>in_that</span>. */
987  virtual bool operator!= (Operator const & in_that) const;
988 
989  /* Tests this operator for equality against the parameter <span class=code>in_that</span>. Same as Operator::Equals. */
990  virtual bool operator== (Operator const & in_that) const;
991 
993  void DetachView();
994 
996  View GetAttachedView() const;
997 
999  virtual UTF8 GetName() const { return "Operator"; }
1000 
1004  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1005 
1009  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1010 
1014  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1015 
1019  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1020 
1024  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1025 
1029  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1030 
1034  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1035 
1039  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1040 
1044  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1045 
1049  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1050 
1054  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1055 
1059  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1060 
1062  virtual void OnViewAttached() { return; }
1063 
1065  virtual void OnViewDetached() { return; }
1066 
1069  virtual void OnModelAttached() { return; }
1070 
1073  virtual void OnModelDetached() { return; }
1074 
1076  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1077 
1080  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1081 
1085  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1086 
1088  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1089 
1091  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1092 
1093  enum class Priority
1094  {
1095  Low,
1096  Normal,
1097  High
1098  };
1099 
1100 protected:
1101 
1102  HPS::MouseButtons mouse_trigger;
1103  HPS::ModifierKeys modifier_trigger;
1104 };
1105 
1108 class SPRK_API OperatorControl : public SprocketControl
1109 {
1110 public:
1112  explicit OperatorControl(View const & in_view);
1113 
1115  OperatorControl(OperatorControl const & in_that);
1116 
1120  OperatorControl(OperatorControl && in_that);
1121 
1125  OperatorControl & operator=(OperatorControl && in_that);
1126 
1128  ~OperatorControl();
1129 
1130  HPS::Type ObjectType() const {return HPS::Type::OperatorControl;};
1131 
1133  OperatorControl & operator=(OperatorControl const & in_that);
1134 
1135 
1137  size_t GetCount();
1138 
1141  size_t GetCount(Operator::Priority in_priority);
1142 
1143 
1149  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1150 
1156  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1157 
1161  bool Pop(Operator::Priority in_priority = Operator::Priority::Normal);
1162 
1167  bool Pop(OperatorPtr & out_operator);
1168 
1174  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1175 
1176 
1182  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1183 
1189  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1190 
1196  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Normal);
1197 
1204  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Normal);
1205 
1206 
1210  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Normal);
1211 
1215  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1216 
1219  OperatorControl & UnsetEverything();
1220 
1221 
1225  bool ShowTop(OperatorPtr & out_operator) const;
1226 
1231  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1232 
1236  bool Show(OperatorPtrArray & out_operators) const;
1237 
1242  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1243 
1244 private:
1246  OperatorControl() {}
1247 };
1248 
1252 {
1253 public:
1254 
1255  enum class Location
1256  {
1257  TopRight,
1258  TopLeft,
1259  BottomRight,
1260  BottomLeft,
1261  Custom,
1262  };
1263 
1265  explicit NavigationCubeControl(View const & in_view);
1266 
1269 
1274 
1278  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1279 
1282 
1283  HPS::Type ObjectType() const {return HPS::Type::NavigationCubeControl;};
1284 
1286  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1287 
1294  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1295 
1298  Location GetLocation() const;
1299 
1303  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1304 
1307  HPS::Rectangle GetPosition() const;
1308 
1313  NavigationCubeControl & SetVisibility(bool in_visibility);
1314 
1317  bool GetVisibility() const;
1318 
1322  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1323 
1326  bool GetTextVisibility() const;
1327 
1342  NavigationCubeControl & SetMaterialPalette(const char * in_material_palette);
1343 
1346  HPS::UTF8 GetMaterialPalette() const;
1347 
1355  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1356 
1357 
1360  bool GetInteractivity() const;
1361 
1366  NavigationCubeControl & SetSize(float in_size);
1367 
1370  float GetSize() const;
1371 
1374  HPS::SegmentKey GetSegmentKey() const;
1375 
1376 private:
1379 
1381  HPS::SegmentKey GetNavigationCubeSegment() const;
1382 };
1383 
1386 class SPRK_API AxisTriadControl : public SprocketControl
1387 {
1388 public:
1389 
1390  enum class Location
1391  {
1392  TopRight,
1393  TopLeft,
1394  BottomRight,
1395  BottomLeft,
1396  Custom,
1397  };
1398 
1400  explicit AxisTriadControl(View const & in_view);
1401 
1403  AxisTriadControl(AxisTriadControl const & in_that);
1404 
1408  AxisTriadControl(AxisTriadControl && in_that);
1409 
1413  AxisTriadControl & operator=(AxisTriadControl && in_that);
1414 
1416  ~AxisTriadControl();
1417 
1418  HPS::Type ObjectType() const {return HPS::Type::AxisTriadControl;};
1419 
1421  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1422 
1429  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1430 
1433  Location GetLocation() const;
1434 
1438  AxisTriadControl & SetPosition(HPS::Rectangle const & in_rectangle);
1439 
1442  HPS::Rectangle GetPosition() const;
1443 
1448  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1449 
1452  bool GetVisibility() const;
1453 
1457  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1458 
1461  bool GetTextVisibility() const;
1462 
1471  HPS::AxisTriadControl & SetMaterialPalette(const char * in_material_palette);
1472 
1475  HPS::UTF8 GetMaterialPalette() const;
1476 
1483  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1484 
1487  bool GetInteractivity() const;
1488 
1493  AxisTriadControl & SetSize(float in_size);
1494 
1497  float GetSize() const;
1498 
1501  HPS::SegmentKey GetSegmentKey() const;
1502 
1503 private:
1505  AxisTriadControl(){};
1506 
1508  HPS::SegmentKey GetAxisTriadSegment() const;
1509 };
1510 
1512 class SPRK_API Component : public Sprocket
1513 {
1514 public:
1517  enum class ComponentType : uint32_t
1518  {
1519  None = 0x00000000,
1520  GenericMask = 0xfffff000,
1521 
1522  ExchangeComponentMask = 0x00001000,
1523  ExchangeModelFile = 0x00001001,
1524  ExchangeProductOccurrence = 0x00001002,
1525  ExchangePartDefinition = 0x00001003,
1526 
1527  ExchangeView = 0x00001004,
1528  ExchangeFilter = 0x00001005,
1529 
1530  ExchangeRepresentationItemMask = 0x00003000,
1531  ExchangeRIBRepModel = 0x00003001,
1532  ExchangeRICurve = 0x00003002,
1533  ExchangeRIDirection = 0x00003003,
1534  ExchangeRIPlane = 0x00003004,
1535  ExchangeRIPointSet = 0x00003005,
1536  ExchangeRIPolyBRepModel = 0x00003006,
1537  ExchangeRIPolyWire = 0x00003007,
1538  ExchangeRISet = 0x00003008,
1539  ExchangeRICoordinateSystem = 0x00003009,
1540 
1541  ExchangeTopologyMask = 0x00005000,
1542  ExchangeTopoBody = 0x00005001,
1543  ExchangeTopoConnex = 0x00005002,
1544  ExchangeTopoShell = 0x00005003,
1545  ExchangeTopoFace = 0x00005004,
1546  ExchangeTopoLoop = 0x00005005,
1547  ExchangeTopoCoEdge = 0x00005006,
1548  ExchangeTopoEdge = 0x00005007,
1549  ExchangeTopoVertex = 0x00005008,
1550  ExchangeTopoSingleWireBody = 0x00005009,
1551  ExchangeTopoWireEdge = 0x0000500a,
1552 
1553  ExchangeDrawingMask = 0x00006000,
1554  ExchangeDrawingModel = 0x00006001,
1555  ExchangeDrawingView = 0x00006002,
1556  ExchangeDrawingSheet = 0x00006003,
1557  ExchangeBasicDrawingBlock = 0x00006004,
1558  ExchangeOperatorDrawingBlock = 0x00006005,
1559 
1560  ExchangePMIMask = 0x00009000,
1561  ExchangePMI = ExchangePMIMask,
1562  ExchangePMIText = 0x00009100,
1563  ExchangePMIRichText = 0x00009200,
1564  ExchangePMIRoughness = 0x00009300,
1565  ExchangePMIGDT = 0x00009400,
1566  ExchangePMIDatum = 0x00009500,
1567  ExchangePMILineWelding = 0x00009600,
1568  ExchangePMISpotWelding = 0x00009700,
1569  ExchangePMIDimension = 0x00009800,
1570  ExchangePMIBalloon = 0x00009900,
1571  ExchangePMICoordinate = 0x00009a00,
1572  ExchangePMIFastener = 0x00009b00,
1573  ExchangePMILocator = 0x00009c00,
1574  ExchangePMIMeasurementPoint = 0x00009d00,
1575 
1576 
1577  ParasolidComponentMask = 0x00010000,
1578 
1579  ParasolidModelFile = 0x00010001,
1580  ParasolidAssembly = 0x00010002,
1581 
1582  ParasolidTopologyMask = 0x00050000,
1583  ParasolidTopoBody = 0x00050001,
1584  ParasolidTopoRegion = 0x00050002,
1585  ParasolidTopoShell = 0x00050003,
1586  ParasolidTopoFace = 0x00050004,
1587  ParasolidTopoLoop = 0x00050005,
1588  ParasolidTopoFin = 0x00050006,
1589  ParasolidTopoEdge = 0x00050007,
1590  ParasolidTopoVertex = 0x00050008,
1591  };
1592 
1593 
1595  Component();
1596 
1599  Component(Component const & in_that);
1600 
1603  Component(Component && in_that);
1604 
1606  virtual ~Component();
1607 
1608  HPS::Type ObjectType() const { return HPS::Type::Component; }
1609 
1610 
1614  Component & operator=(Component const & in_that);
1615 
1619  Component & operator=(Component && in_that);
1620 
1624  virtual void Assign(Component const & in_that);
1625 
1629  bool Equals(Component const & in_that) const;
1630 
1634  bool operator!=(Component const & in_that) const;
1635 
1639  bool operator==(Component const & in_that) const;
1640 
1641 
1644  ComponentType GetComponentType() const;
1645 
1649  bool HasComponentType(ComponentType in_mask) const;
1650 
1651 
1652 
1658  void AddKey(Key const & in_key);
1659 
1662  KeyArray GetKeys() const;
1663 
1664 
1665 
1670  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1671 
1675  ComponentArray GetOwners() const;
1676 
1679  ComponentArray GetSubcomponents() const;
1680 
1685  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1686 
1687 
1688 
1691  void AddReference(Component & in_reference);
1692 
1695  ComponentArray GetReferrers() const;
1696 
1700  ComponentArray GetReferences() const;
1701 
1702 
1703 
1706  MetadataArray GetAllMetadata() const;
1707 
1711  Metadata GetMetadata(char const * in_name) const;
1712 
1713 
1714 
1719  void Delete();
1720 
1721 
1729  static KeyPathArray GetKeyPath(Component const & in_component);
1730 
1740  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
1741 
1750  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
1751 };
1752 
1755 class SPRK_API ComponentPath : public Sprocket
1756 {
1757 public:
1759  ComponentPath();
1760 
1763  ComponentPath(ComponentArray const & in_components);
1764 
1768  ComponentPath(size_t in_count, Component const in_components[]);
1769 
1771  ComponentPath(ComponentPath const & in_that);
1772 
1776  ComponentPath(ComponentPath && in_that);
1777 
1781  ComponentPath & operator=(ComponentPath && in_that);
1782 
1784  virtual ~ComponentPath();
1785 
1786  HPS::Type ObjectType() const { return HPS::Type::ComponentPath; }
1787 
1791  ComponentPath & operator+=(Component const & in_component);
1792 
1796  ComponentPath & operator+=(ComponentPath const & in_path);
1797 
1801  ComponentPath & operator+=(ComponentArray const & in_components);
1802 
1806  ComponentPath & Append(Component const & in_component);
1807 
1811  ComponentPath & Append(ComponentPath const & in_path);
1812 
1816  ComponentPath & Append(ComponentArray const & in_components);
1817 
1821  ComponentPath & operator=(ComponentPath const & in_that);
1822 
1826  ComponentPath & operator=(ComponentArray const & in_path);
1827 
1830  void Set(ComponentPath const & in_that);
1831 
1835  bool Equals(ComponentPath const & in_that) const;
1836 
1840  bool operator!= (ComponentPath const & in_that) const;
1841 
1845  bool operator== (ComponentPath const & in_that) const;
1846 
1847 
1851  ComponentPath & SetComponents(ComponentArray const & in_components);
1852 
1857  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
1858 
1861  ComponentArray GetComponents() const;
1862 
1866  KeyPathArray GetKeyPaths() const;
1867 
1872  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
1873 
1874 
1878  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
1879 
1884  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
1885 
1889  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
1890 
1895  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
1896 
1897 
1901  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
1902 
1906  void Show(Canvas const & in_canvas, size_t in_layer = 0);
1907 
1911  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
1912 
1913  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0);
1914 };
1915 
1916 
1921 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
1922 {
1923  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1924 }
1925 
1930 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
1931 {
1932  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1933 }
1934 
1939 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
1940 {
1941  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1942 }
1943 
1948 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
1949 {
1950  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1951 }
1952 
1957 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
1958 {
1959  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1960 }
1961 
1966 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
1967 {
1968  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1969 }
1970 
1975 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
1976 {
1977  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1978 }
1979 
1984 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
1985 {
1986  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1987 }
1988 
1993 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
1994 {
1995  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1996 }
1997 
1998 
2000 class SPRK_API ComponentHighlightEvent : public Event
2001 {
2002 public:
2003  enum class Action
2004  {
2005  None = 0,
2006  Highlight,
2007  Unhighlight,
2008  };
2009 
2012  {
2013  channel = GetClassID();
2014  consumable = false;
2015  action = Action::None;
2016  }
2017 
2018  ComponentHighlightEvent(Action in_action,
2019  ComponentPath const & in_path = ComponentPath(),
2020  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2021  : Event(), action(in_action), path(in_path), options(in_options)
2022  {
2023  channel = GetClassID();
2024  consumable = false;
2025  }
2026 
2029  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2030  {
2031  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2032  {
2033  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2034  action = that.action;
2035  path = that.path;
2036  options = that.options;
2037  }
2038  else
2039  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2040  }
2041 
2043 
2046  Event * Clone() const
2047  {
2048  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2049  return new_event;
2050  }
2051 
2052  Action action;
2053  ComponentPath path;
2054  HighlightOptionsKit options;
2055 };
2056 
2057 
2059 class SPRK_API Filter : public Component
2060 {
2061 public:
2063  Filter();
2064 
2068  Filter(Component const & in_that);
2069 
2072  Filter(Filter const & in_that);
2073 
2076  Filter(Filter && in_that);
2077 
2078  virtual ~Filter();
2079 
2080  HPS::Type ObjectType() const { return HPS::Type::Filter; }
2081 
2082 #ifndef _MSC_VER
2083  Filter & operator=(Filter const & in_that) = default;
2084 #endif
2085 
2089  Filter & operator=(Filter && in_that);
2090 
2091 
2094  void Activate(View const & in_view);
2095 
2098  void Deactivate(View const & in_view);
2099 };
2100 
2101 
2102 class SPRK_API FilterActivationEvent : public Event
2103 {
2104 public:
2105  enum class Action
2106  {
2107  None = 0,
2108  Activate,
2109  Deactivate,
2110  };
2111 
2114  {
2115  channel = GetClassID();
2116  consumable = false;
2117  }
2118 
2119  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2120  {
2121  channel = GetClassID();
2122  consumable = false;
2123  }
2124 
2127  FilterActivationEvent(Event const & in_event) : Event(in_event)
2128  {
2129  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2130  {
2131  auto that = static_cast<FilterActivationEvent const &>(in_event);
2132  filter = that.filter;
2133  action = that.action;
2134  view = that.view;
2135  }
2136  else
2137  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2138  }
2139 
2141 
2144  Event * Clone() const
2145  {
2146  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2147  return new_event;
2148  }
2149 
2150  Filter filter;
2151  Action action;
2152  View view;
2153 };
2154 
2155 
2157 class SPRK_API Capture : public Component
2158 {
2159 public:
2161  Capture();
2162 
2166  Capture(Component const & in_that);
2167 
2170  Capture(Capture const & in_that);
2171 
2174  Capture(Capture && in_that);
2175 
2176  virtual ~Capture();
2177 
2178  HPS::Type ObjectType() const { return HPS::Type::Capture; }
2179 
2180 #ifndef _MSC_VER
2181  Capture & operator=(Capture const & in_that) = default;
2182 #endif
2183 
2187  Capture & operator=(Capture && in_that);
2188 
2189 
2193  View Activate();
2194 };
2195 
2196 
2197 class SPRK_API CaptureActivationEvent : public Event
2198 {
2199 public:
2202  {
2203  channel = GetClassID();
2204  consumable = false;
2205  }
2206 
2207  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2208  {
2209  channel = GetClassID();
2210  consumable = false;
2211  }
2212 
2215  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2216  {
2217  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2218  {
2219  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2220  capture = that.capture;
2221  view = that.view;
2222  }
2223  else
2224  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2225  }
2226 
2228 
2231  Event * Clone() const
2232  {
2233  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2234  return new_event;
2235  }
2236 
2237  Capture capture;
2238  View view;
2239 };
2240 
2241 
2243 class SPRK_API CADModel : public Component
2244 {
2245 public:
2247  CADModel();
2248 
2252  CADModel(Component const & in_that);
2253 
2256  CADModel(CADModel const & in_that);
2257 
2260  CADModel(CADModel && in_that);
2261 
2264  CADModel(Model const & in_that);
2265 
2266  virtual ~CADModel();
2267 
2268  HPS::Type ObjectType() const { return HPS::Type::CADModel; }
2269 
2270 #ifndef _MSC_VER
2271  CADModel & operator=(CADModel const & in_that) = default;
2272 #endif
2273 
2277  CADModel & operator=(CADModel && in_that);
2278 
2279 
2283  Component GetComponentFromKey(Key const & in_key) const;
2284 
2289  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2290 
2296  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2297 
2298 
2301  Model GetModel() const;
2302 
2305  FilterArray GetAllFilters() const;
2306 
2309  CaptureArray GetAllCaptures() const;
2310 
2314  FilterArray GetActiveFilters(View const & in_view) const;
2315 
2316 
2320  View ActivateDefaultCapture();
2321 
2322 
2330  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2331 };
2332 
2333 
2334 
2337 class SPRK_API Metadata : public Sprocket
2338 {
2339 public:
2341  Metadata();
2342 
2345  Metadata(Metadata const & in_that);
2346 
2349  Metadata(Metadata && in_that);
2350 
2353  Metadata(char const * in_name);
2354 
2355  virtual ~Metadata();
2356 
2357  HPS::Type ObjectType() const { return HPS::Type::Metadata; }
2358 
2359 
2363  Metadata & operator=(Metadata const & in_that);
2364 
2368  Metadata & operator=(Metadata && in_that);
2369 
2373  virtual void Assign(Metadata const & in_that);
2374 
2378  bool Equals(Metadata const & in_that) const;
2379 
2383  bool operator!=(Metadata const & in_that) const;
2384 
2388  bool operator==(Metadata const & in_that) const;
2389 
2390 
2393  HPS::UTF8 GetName() const;
2394 
2397  void SetName(char const * in_name);
2398 };
2399 
2401 class SPRK_API IntegerMetadata : public Metadata
2402 {
2403 public:
2405  IntegerMetadata();
2406 
2410  IntegerMetadata(Metadata const & in_that);
2411 
2414  IntegerMetadata(IntegerMetadata const & in_that);
2415 
2418  IntegerMetadata(IntegerMetadata && in_that);
2419 
2423  IntegerMetadata(char const * in_name, int in_value);
2424 
2425  virtual ~IntegerMetadata();
2426 
2427  HPS::Type ObjectType() const { return HPS::Type::IntegerMetadata; }
2428 
2429 #ifndef _MSC_VER
2430  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2431 #endif
2432 
2436  IntegerMetadata & operator=(IntegerMetadata && in_that);
2437 
2438 
2441  int GetValue() const;
2442 
2445  void SetValue(int in_value);
2446 };
2447 
2449 class SPRK_API UnsignedIntegerMetadata : public Metadata
2450 {
2451 public:
2454 
2458  UnsignedIntegerMetadata(Metadata const & in_that);
2459 
2463 
2467 
2471  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2472 
2473  virtual ~UnsignedIntegerMetadata();
2474 
2475  HPS::Type ObjectType() const { return HPS::Type::UnsignedIntegerMetadata; }
2476 
2477 #ifndef _MSC_VER
2478  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2479 #endif
2480 
2484  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2485 
2486 
2489  unsigned int GetValue() const;
2490 
2493  void SetValue(unsigned int in_value);
2494 };
2495 
2497 class SPRK_API DoubleMetadata : public Metadata
2498 {
2499 public:
2501  DoubleMetadata();
2502 
2506  DoubleMetadata(Metadata const & in_that);
2507 
2510  DoubleMetadata(DoubleMetadata const & in_that);
2511 
2514  DoubleMetadata(DoubleMetadata && in_that);
2515 
2519  DoubleMetadata(char const * in_name, double in_value);
2520 
2521  virtual ~DoubleMetadata();
2522 
2523  HPS::Type ObjectType() const { return HPS::Type::DoubleMetadata; }
2524 
2525 #ifndef _MSC_VER
2526  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2527 #endif
2528 
2532  DoubleMetadata & operator=(DoubleMetadata && in_that);
2533 
2534 
2537  double GetValue() const;
2538 
2541  void SetValue(double in_value);
2542 };
2543 
2545 class SPRK_API StringMetadata : public Metadata
2546 {
2547 public:
2549  StringMetadata();
2550 
2554  StringMetadata(Metadata const & in_that);
2555 
2558  StringMetadata(StringMetadata const & in_that);
2559 
2562  StringMetadata(StringMetadata && in_that);
2563 
2567  StringMetadata(char const * in_name, char const * in_value);
2568 
2569  virtual ~StringMetadata();
2570 
2571  HPS::Type ObjectType() const { return HPS::Type::StringMetadata; }
2572 
2573 #ifndef _MSC_VER
2574  StringMetadata & operator=(StringMetadata const & in_that) = default;
2575 #endif
2576 
2580  StringMetadata & operator=(StringMetadata && in_that);
2581 
2582 
2585  UTF8 GetValue() const;
2586 
2589  void SetValue(char const * in_value);
2590 };
2591 
2593 class SPRK_API TimeMetadata : public Metadata
2594 {
2595 public:
2597  TimeMetadata();
2598 
2602  TimeMetadata(Metadata const & in_that);
2603 
2606  TimeMetadata(TimeMetadata const & in_that);
2607 
2610  TimeMetadata(TimeMetadata && in_that);
2611 
2615  TimeMetadata(char const * in_name, unsigned int in_value);
2616 
2617  virtual ~TimeMetadata();
2618 
2619  HPS::Type ObjectType() const { return HPS::Type::TimeMetadata; }
2620 
2621 #ifndef _MSC_VER
2622  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
2623 #endif
2624 
2628  TimeMetadata & operator=(TimeMetadata && in_that);
2629 
2630 
2633  unsigned int GetValue() const;
2634 
2637  HPS::UTF8 GetValueAsString() const;
2638 
2641  void SetValue(unsigned int in_value);
2642 };
2643 
2644 
2646 class SPRK_API BooleanMetadata : public Metadata
2647 {
2648 public:
2650  BooleanMetadata();
2651 
2655  BooleanMetadata(Metadata const & in_that);
2656 
2659  BooleanMetadata(BooleanMetadata const & in_that);
2660 
2663  BooleanMetadata(BooleanMetadata && in_that);
2664 
2668  BooleanMetadata(char const * in_name, bool in_value);
2669 
2670  virtual ~BooleanMetadata();
2671 
2672  HPS::Type ObjectType() const { return HPS::Type::BooleanMetadata; }
2673 
2674 #ifndef _MSC_VER
2675  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
2676 #endif
2677 
2681  BooleanMetadata & operator=(BooleanMetadata && in_that);
2682 
2683 
2686  bool GetValue() const;
2687 
2690  void SetValue(bool in_value);
2691 };
2692 
2693 
2694 
2696 class SPRK_API Factory : public Sprocket
2697 {
2698 public:
2699 
2702  static CanvasArray GetCanvases();
2703 
2706  static LayoutArray GetLayouts();
2707 
2710  static ViewArray GetViews();
2711 
2714  static ModelArray GetModels();
2715 
2718  static CADModelArray GetCADModels();
2719 
2725  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
2726 
2731  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
2732 
2738  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
2739 
2743  static Layout CreateLayout(char const * in_name = "");
2744 
2748  static View CreateView(char const * in_name = "");
2749 
2753  static Model CreateModel(char const * in_name = "");
2754 
2755 private:
2756  Factory() {}
2757 };
2758 
2768 class SPRK_API AxisTriadOperator : public Operator
2769 {
2770 public:
2771  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2773  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
2774 
2780  virtual bool OnMouseDown(MouseState const & in_state);
2785  virtual bool OnMouseUp(MouseState const & in_state);
2790  virtual bool OnMouseMove(MouseState const & in_state);
2791 
2796  virtual bool OnTouchDown(TouchState const & in_state);
2801  virtual bool OnTouchUp(TouchState const & in_state);
2806  virtual bool OnTouchMove(TouchState const & in_state);
2807 
2808  virtual void OnViewAttached();
2809  virtual void OnViewDetached();
2810 
2811 private:
2812 
2813  bool AxisOrbit(HPS::WindowPoint const & in_loc);
2814  void Transition(HPS::SelectionResults selection_results);
2815  void TranslatePoint(HPS::WindowPoint * point);
2816  bool IsEventRelevant(HPS::Point const & event_location);
2817 
2818  bool operator_active;
2819  HPS::WindowPoint start_point;
2820  HPS::Vector start_sphere_point;
2821  float axis_subwindow_width;
2822  float axis_subwindow_height;
2823  HPS::TouchID tracked_touch_ID;
2824  HPS::Rectangle axis_subwindow;
2825  HPS::SegmentKey axis_triad_segment;
2826 
2827 };
2828 
2831 {
2832 public:
2835  virtual ~SmoothTransitionCompleteEvent();
2836 
2839  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
2840  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
2841 
2844  Event * Clone() const
2845  {
2847  return new_event;
2848  }
2849 
2853  virtual bool Drop(Event const * in_that_event) const
2854  {
2855  HPS_UNREFERENCED(in_that_event);
2856  return false;
2857  }
2858 
2859  HPS::View view;
2860 };
2861 
2871 class SPRK_API NavigationCubeOperator : public Operator
2872 {
2873 public:
2874  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2875  ~NavigationCubeOperator() { OnViewDetached(); }
2876 
2878  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
2879 
2884  virtual bool OnMouseDown(MouseState const & in_state);
2889  virtual bool OnMouseUp(MouseState const & in_state);
2894  virtual bool OnMouseMove(MouseState const & in_state);
2895 
2899  virtual bool OnTouchDown(TouchState const & in_state);
2904  virtual bool OnTouchUp(TouchState const & in_state);
2909  virtual bool OnTouchMove(TouchState const & in_state);
2910 
2911  virtual void OnViewAttached();
2912  virtual void OnViewDetached();
2913 
2914  virtual void OnModelAttached();
2915 
2916  void UpdateHighlightColor();
2917 
2918  /* Sets a segment as the reference segment. All rotations happen around the reference segment.
2919  By default the reference segment is the View segment.
2920  /param in_segment the segment to rotate around. */
2921  void SetReferenceSegment(HPS::SegmentKey const & in_segment);
2922 
2923  /* Sets a group of segments as the reference segments.
2924  * All rotations happen around the combined bounding box of the reference segments.
2925  By default the reference segment is the View segment.
2926  /param in_segments the segments to rotate around. */
2927  void SetReferenceSegment(HPS::SegmentKeyArray const & in_segments);
2928 
2929  /* Returns the segments used as a reference for rotations
2930  By default the reference segment is the View segment.
2931  /return the segments to rotate around. */
2932  HPS::SegmentKeyArray ShowReferenceSegment();
2933 
2934 private:
2935  void Transition(HPS::SelectionResults selection_results);
2936  bool Orbit(HPS::WindowPoint const & in_loc);
2937  void TranslatePoint(HPS::WindowPoint * point);
2938  bool IsEventRelevant(HPS::Point const & event_location);
2939  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
2940 
2941  bool operator_active;
2942  HPS::TouchID tracked_touch_ID;
2943  HPS::WindowPoint start_point;
2944  HPS::WindowPoint down_position;
2945  HPS::Vector start_sphere_point;
2946  HPS::SegmentKeyArray reference_segments; //rotation and zooming happen around these segments
2947 
2948  HPS::SegmentKey nav_cube_segment;
2949  HPS::SegmentKey style_segment;
2950  HPS::PortfolioKey portfolio;
2951  HPS::ReferenceKeyArrayArray groups;
2952  HPS::HighlightOptionsKit highlight_options_kit;
2953  HPS::CameraKit previous_camera;
2954  int previous_face;
2955 
2956  HPS::Rectangle nav_cube_subwindow;
2957  float nav_cube_subwindow_width;
2958  float nav_cube_subwindow_height;
2959 
2960  int highlighted_group;
2961 
2962  bool moving;
2963 
2964  class SmoothTransitionCompleteEventHandler : public EventHandler
2965  {
2966  public:
2967  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
2968  : handler_view(in_view), handler_moving(&in_moving) {}
2969 
2970  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
2971 
2972  virtual HandleResult Handle(HPS::Event const * in_event);
2973 
2974  private:
2975  View handler_view;
2976  bool * handler_moving;
2977  };
2978 
2979  SmoothTransitionCompleteEventHandler * handler;
2980 };
2981 
2982 
2983 
2984 
2985 class SceneTreeItem;
2986 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
2987 class SceneTree;
2988 typedef std::shared_ptr<SceneTree> SceneTreePtr;
2989 
2992 class SPRK_API SceneTree : public Sprocket
2993 {
2994 public:
2997  enum class ItemType : uint32_t
2998  {
2999  None = 0x00000000,
3000  GenericMask = 0xffff0000,
3001 
3002  Segment = 0x00000001,
3003  Include = 0x00000002,
3004  ConditionalExpression = 0x00000003,
3005  StaticModelSegment = 0x00000004,
3006  AttributeFilter = 0x00000005,
3007 
3008  Geometry = 0x00010000,
3009  CuttingSection = 0x00010001,
3010  Shell = 0x00010002,
3011  Mesh = 0x00010003,
3012  Grid = 0x00010004,
3013  NURBSSurface = 0x00010005,
3014  Cylinder = 0x00010006,
3015  Sphere = 0x00010007,
3016  Polygon = 0x00010008,
3017  Circle = 0x00010009,
3018  CircularWedge = 0x0001000a,
3019  Ellipse = 0x0001000b,
3020  Line = 0x0001000c,
3021  NURBSCurve = 0x0001000d,
3022  CircularArc = 0x0001000e,
3023  EllipticalArc = 0x0001000f,
3024  InfiniteLine = 0x00010010,
3025  InfiniteRay = 0x00010011,
3026  Marker = 0x00010012,
3027  Text = 0x00010013,
3028  Reference = 0x00010014,
3029  DistantLight = 0x00010015,
3030  Spotlight = 0x00010016,
3031 
3032  Attribute = 0x00020000,
3033  Portfolio = 0x00020001,
3034  SegmentStyle = 0x00020002,
3035  NamedStyle = 0x00020003,
3036  MaterialPalette = 0x00020004,
3037  Priority = 0x00020005,
3038  Material = 0x00020006,
3039  Camera = 0x00020007,
3040  ModellingMatrix = 0x00020008,
3041  UserData = 0x00020009,
3042  TextureMatrix = 0x0002000a,
3043  Culling = 0x0002000b,
3044  CurveAttribute = 0x0002000c,
3045  CylinderAttribute = 0x0002000d,
3046  EdgeAttribute = 0x0002000e,
3047  LightingAttribute = 0x0002000f,
3048  LineAttribute = 0x00020010,
3049  MarkerAttribute = 0x00020011,
3050  SurfaceAttribute = 0x00020012,
3051  Selectability = 0x00020013,
3052  SphereAttribute = 0x00020014,
3053  Subwindow = 0x00020015,
3054  TextAttribute = 0x00020016,
3055  Transparency = 0x00020017,
3056  Visibility = 0x00020018,
3057  VisualEffects = 0x00020019,
3058  Performance = 0x00020020,
3059  DrawingAttribute = 0x00020021,
3060  HiddenLineAttribute = 0x00020022,
3061  ContourLine = 0x00020023,
3062  Condition = 0x00020024,
3063  Bounding = 0x00020025,
3064  AttributeLock = 0x00020026,
3065  TransformMask = 0x00020027,
3066  ColorInterpolation = 0x00020028,
3067  CuttingSectionAttribute = 0x00020029,
3068 
3069  // window only attributes
3070  Debugging = 0x00020030,
3071  PostProcessEffects = 0x00020031,
3072  SelectionOptions = 0x00020032,
3073  UpdateOptions = 0x00020033,
3074 
3075  Definition = 0x00040000,
3076  NamedStyleDefinition = 0x00040001,
3077  TextureDefinition = 0x00040002,
3078  LinePatternDefinition = 0x00040003,
3079  GlyphDefinition = 0x00040004,
3080  CubeMapDefinition = 0x00040005,
3081  ImageDefinition = 0x00040006,
3082  MaterialPaletteDefinition = 0x00040007,
3083  ShaderDefinition = 0x00040008,
3084 
3085  Group = 0x00080000,
3086  SegmentGroup = 0x00080100,
3087  GeometryGroup = 0x00080200,
3088  AttributeGroup = 0x00080300,
3089  PortfolioGroup = 0x00080400,
3090  StyleGroup = 0x00080500,
3091  IncludeGroup = 0x00080600,
3092  DefinitionGroup = 0x00180000,
3093  NamedStyleDefinitionGroup = 0x00180700,
3094  TextureDefinitionGroup = 0x00180800,
3095  LinePatternDefinitionGroup = 0x00180900,
3096  GlyphDefinitionGroup = 0x00180a00,
3097  CubeMapDefinitionGroup = 0x00180b00,
3098  ImageDefinitionGroup = 0x00180c00,
3099  MaterialPaletteDefinitionGroup = 0x00180d00,
3100  ShaderDefinitionGroup = 0x00180e00,
3101  CuttingSectionGroup = 0x00080001,
3102  ShellGroup = 0x00080002,
3103  MeshGroup = 0x00080003,
3104  GridGroup = 0x00080004,
3105  NURBSSurfaceGroup = 0x00080005,
3106  CylinderGroup = 0x00080006,
3107  SphereGroup = 0x00080007,
3108  PolygonGroup = 0x00080008,
3109  CircleGroup = 0x00080009,
3110  CircularWedgeGroup = 0x0008000a,
3111  EllipseGroup = 0x0008000b,
3112  LineGroup = 0x0008000c,
3113  NURBSCurveGroup = 0x0008000d,
3114  CircularArcGroup = 0x0008000e,
3115  EllipticalArcGroup = 0x0008000f,
3116  InfiniteLineGroup = 0x00080010,
3117  InfiniteRayGroup = 0x00080011,
3118  MarkerGroup = 0x00080012,
3119  TextGroup = 0x00080013,
3120  ReferenceGroup = 0x00080014,
3121  DistantLightGroup = 0x00080015,
3122  SpotlightGroup = 0x00080016,
3123  };
3124 
3126  SceneTree();
3127 
3130  SceneTree(Canvas const & in_canvas);
3131 
3134  SceneTree(SceneTree const & in_that);
3135 
3138  SceneTree(SceneTree && in_that);
3139 
3140  virtual ~SceneTree();
3141 
3142  virtual HPS::Type ObjectType() const { return HPS::Type::SceneTree; }
3143 
3147  SceneTree & operator=(SceneTree const & in_that);
3148 
3152  SceneTree & operator=(SceneTree && in_that);
3153 
3157  virtual void Assign(SceneTree const & in_that);
3158 
3162  bool Equals(SceneTree const & in_that) const;
3163 
3167  bool operator!=(SceneTree const & in_that) const;
3168 
3172  bool operator==(SceneTree const & in_that) const;
3173 
3174 
3182  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3183 
3186  HighlightOptionsKit GetHighlightOptions() const;
3187 
3188 
3193  void SetGroupingLimit(size_t in_limit);
3194 
3197  size_t GetGroupingLimit() const;
3198 
3199 
3206  void SetRoot(SceneTreeItemPtr const & in_root);
3207 
3210  SceneTreeItemPtr GetRoot() const;
3211 
3212 
3215  virtual void Flush();
3216 };
3217 
3218 
3221 class SPRK_API SceneTreeItem : public Sprocket
3222 {
3223 public:
3225  SceneTreeItem();
3226 
3229  SceneTreeItem(SceneTreeItem const & in_that);
3230 
3233  SceneTreeItem(SceneTreeItem && in_that);
3234 
3240  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3241 
3247  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3248 
3254  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3255 
3261  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3262 
3270  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3271 
3272  virtual ~SceneTreeItem();
3273 
3274  HPS::Type ObjectType() const { return HPS::Type::SceneTreeItem; }
3275 
3279  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3280 
3284  SceneTreeItem & operator=(SceneTreeItem && in_that);
3285 
3289  virtual void Assign(SceneTreeItem const & in_that);
3290 
3294  bool Equals(SceneTreeItem const & in_that) const;
3295 
3299  bool operator!=(SceneTreeItem const & in_that) const;
3300 
3304  bool operator==(SceneTreeItem const & in_that) const;
3305 
3306 
3309  SceneTreePtr GetTree() const;
3310 
3313  UTF8 GetTitle() const;
3314 
3317  SceneTree::ItemType GetItemType() const;
3318 
3322  bool HasItemType(SceneTree::ItemType in_mask) const;
3323 
3326  Key GetKey() const;
3327 
3330  bool HasChildren() const;
3331 
3332 
3341  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3342 
3343 
3346  virtual void Expand();
3347 
3350  virtual void Collapse();
3351 
3352 
3357  bool IsSelected() const;
3358 
3364  virtual void Select();
3365 
3371  virtual void Unselect();
3372 
3377  bool IsHighlightable() const;
3378 
3384  bool IsHighlighted() const;
3385 
3389  void Highlight();
3390 
3395  void Unhighlight();
3396 };
3397 
3398 
3399 
3400 class ComponentTreeItem;
3401 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3402 class ComponentTree;
3403 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3404 
3407 class SPRK_API ComponentTree : public Sprocket
3408 {
3409 public:
3412  enum class ItemType
3413  {
3414  None,
3415  ExchangeComponent,
3416  ExchangeModelFile,
3417 
3418  ExchangeViewGroup,
3419  ExchangeAnnotationViewGroup,
3420  ExchangePMIGroup,
3421  ExchangeModelGroup,
3422 
3423  ParasolidComponent,
3424  ParasolidModelFile,
3425  };
3426 
3428  ComponentTree();
3429 
3433  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3434 
3437  ComponentTree(ComponentTree const & in_that);
3438 
3441  ComponentTree(ComponentTree && in_that);
3442 
3443  virtual ~ComponentTree();
3444 
3445  virtual HPS::Type ObjectType() const { return HPS::Type::ComponentTree; }
3446 
3450  ComponentTree & operator=(ComponentTree const & in_that);
3451 
3455  ComponentTree & operator=(ComponentTree && in_that);
3456 
3460  virtual void Assign(ComponentTree const & in_that);
3461 
3465  bool Equals(ComponentTree const & in_that) const;
3466 
3470  bool operator!=(ComponentTree const & in_that) const;
3471 
3475  bool operator==(ComponentTree const & in_that) const;
3476 
3477 
3485  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3486 
3489  HighlightOptionsKit GetHighlightOptions() const;
3490 
3491 
3498  void SetRoot(ComponentTreeItemPtr const & in_root);
3499 
3502  ComponentTreeItemPtr GetRoot() const;
3503 
3504 
3507  virtual void Flush();
3508 };
3509 
3510 
3513 class SPRK_API ComponentTreeItem : public Sprocket
3514 {
3515 public:
3518 
3521  ComponentTreeItem(ComponentTreeItem const & in_that);
3522 
3526 
3532  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
3533 
3540  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
3541 
3542  virtual ~ComponentTreeItem();
3543 
3544  HPS::Type ObjectType() const { return HPS::Type::ComponentTreeItem; }
3545 
3549  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
3550 
3554  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
3555 
3559  virtual void Assign(ComponentTreeItem const & in_that);
3560 
3564  bool Equals(ComponentTreeItem const & in_that) const;
3565 
3569  bool operator!=(ComponentTreeItem const & in_that) const;
3570 
3574  bool operator==(ComponentTreeItem const & in_that) const;
3575 
3576 
3577 
3580  ComponentTreePtr GetTree() const;
3581 
3584  UTF8 GetTitle() const;
3585 
3588  ComponentTree::ItemType GetItemType() const;
3589 
3592  Component GetComponent() const;
3593 
3596  bool HasChildren() const;
3597 
3600  ComponentPath GetPath() const;
3601 
3602 
3610  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
3611 
3612 
3615  virtual void Expand();
3616 
3619  virtual void Collapse();
3620 
3621 
3627  bool IsHighlighted() const;
3628 
3633  virtual void OnHighlight(HighlightOptionsKit const & in_options);
3634 
3639  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
3640 
3641 
3645  void Highlight();
3646 
3650  void Unhighlight();
3651 
3652 
3662  bool IsHidden() const;
3663 
3667  virtual void OnHide();
3668 
3672  virtual void OnShow();
3673 
3677  void Hide();
3678 
3682  void Show();
3683 
3688  void Isolate();
3689 
3692  bool IsExpanded() const;
3693 };
3694 
3695 
3696 
3697 
3698 }
3699 #endif
3700 
3701 
3702 
Definition: sprk.h:2593
HPS::Type ObjectType() const
Definition: sprk.h:2427
Definition: hps.h:6005
HPS::Type ObjectType() const
Definition: sprk.h:437
Event * Clone() const
Definition: sprk.h:678
Definition: sprk.h:2768
Definition: sprk.h:238
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2029
HPS::Type ObjectType() const
Definition: sprk.h:246
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1059
Definition: hps.h:37852
Definition: hps.h:1487
ComponentHighlightEvent()
Definition: sprk.h:2011
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1085
Definition: hps.h:460
HPS::Type ObjectType() const
Definition: sprk.h:215
HPS::Type ObjectType() const
Definition: sprk.h:976
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1049
HPS::Type ObjectType() const
Definition: sprk.h:2080
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5523
Location
Definition: sprk.h:1255
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1088
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1054
ItemType
Definition: sprk.h:3412
Definition: hps.h:5563
CaptureActivationEvent()
Definition: sprk.h:2201
Definition: sprk.h:69
Definition: sprk.h:212
Definition: sprk.h:600
Definition: sprk.h:105
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1014
Definition: sprk.h:3513
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1024
Definition: sprk.h:2646
HPS::Type ObjectType() const
Definition: sprk.h:2268
Definition: hps.h:37639
Definition: hps.h:1318
Definition: hps.h:1041
HPS::Type ObjectType() const
Definition: sprk.h:1786
Definition: hps.h:1659
ModelDeletedEvent()
Definition: sprk.h:886
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:2839
Definition: sprk.h:3407
Definition: hps.h:41948
Definition: sprk.h:927
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1039
Definition: hps.h:7380
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1080
virtual HPS::Type ObjectType() const
Definition: sprk.h:3142
Definition: hps.h:3399
Definition: hps.h:1986
Definition: sprk.h:837
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:722
Definition: sprk.h:688
Definition: hps.h:1377
Definition: hps.h:872
HPS::Type ObjectType() const
Definition: sprk.h:1418
UpdateControl
Definition: hps.h:168
Definition: hps.h:37757
virtual void OnModelDetached()
Definition: sprk.h:1073
Definition: hps.h:1705
Definition: hps.h:1516
Definition: hps.h:8581
Definition: hps.h:229
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1076
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1757
Event * Clone() const
Definition: sprk.h:828
Definition: hps.h:41847
Definition: hps.h:36748
Definition: sprk.h:1251
Definition: sprk.h:882
Definition: sprk.h:497
HPS::Type ObjectType() const
Definition: sprk.h:112
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:764
virtual void OnViewDetached()
Definition: sprk.h:1065
Definition: hps.h:36794
HPS::Type ObjectType() const
Definition: sprk.h:3274
LayoutDeletedEvent()
Definition: sprk.h:692
Event * Clone() const
Definition: sprk.h:872
virtual void OnViewAttached()
Definition: sprk.h:1062
Definition: hps.h:36264
Definition: hps.h:38998
Definition: hps.h:1080
Definition: sprk.h:2337
LayoutDetachedEvent()
Definition: sprk.h:647
Definition: sprk.h:2449
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1029
Definition: hps.h:9182
Definition: hps.h:37800
Definition: hps.h:1464
SmoothTransitionCompleteEvent()
Definition: sprk.h:2834
Definition: hps.h:1403
HPS::Type ObjectType() const
Definition: sprk.h:504
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1009
FilterActivationEvent()
Definition: sprk.h:2113
Definition: hps.h:1422
virtual void OnModelAttached()
Definition: sprk.h:1069
Definition: hps.h:34734
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2127
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:856
HPS::Type ObjectType() const
Definition: sprk.h:1283
HPS::Type ObjectType() const
Definition: sprk.h:1608
Definition: hps.h:6753
Location
Definition: sprk.h:1390
Definition: hps.h:41339
Definition: sprk.h:2401
Definition: sprk.h:1386
Definition: hps.h:39170
HPS::Type ObjectType() const
Definition: sprk.h:1130
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:228
Definition: hps.h:40500
virtual UTF8 GetName() const
Definition: sprk.h:999
Definition: hps.h:41735
Definition: sprk.h:643
Event * Clone() const
Definition: sprk.h:2144
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2215
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1034
HPS::Type ObjectType() const
Definition: sprk.h:2523
CanvasDeletedEvent()
Definition: sprk.h:604
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1019
HPS::Type ObjectType() const
Definition: sprk.h:2357
HPS::Type ObjectType() const
Definition: sprk.h:2475
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:223
Event * Clone() const
Definition: sprk.h:2231
Definition: hps.h:14252
ViewDeletedEvent()
Definition: sprk.h:798
intptr_t GetChannel() const
Definition: hps.h:6138
Definition: sprk.h:731
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:2853
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2773
Definition: sprk.h:1512
Definition: hps.h:39447
Definition: hps.h:40988
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:813
Definition: hps.h:38188
Definition: hps.h:34335
Definition: sprk.h:2545
ViewDetachedEvent()
Definition: sprk.h:742
Definition: hps.h:6105
Definition: sprk.h:1108
Definition: hps.h:396
HPS::Type ObjectType() const
Definition: sprk.h:2571
Event * Clone() const
Definition: sprk.h:2046
Definition: sprk.h:430
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:619
Definition: sprk.h:2871
Definition: sprk.h:1755
ComponentType
Definition: sprk.h:1517
Definition: hps.h:40426
Definition: hps.h:7008
Definition: sprk.h:2000
Event * Clone() const
Definition: sprk.h:634
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:662
HPS::Type ObjectType() const
Definition: sprk.h:3544
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1004
ItemType
Definition: sprk.h:2997
Definition: sprk.h:2059
Definition: sprk.h:2696
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2878
Definition: sprk.h:189
Definition: sprk.h:2830
Definition: hps.h:416
Event * Clone() const
Definition: sprk.h:916
Definition: sprk.h:2157
Definition: hps.h:2004
ModelDetachedEvent()
Definition: sprk.h:841
static MouseButtons ButtonLeft()
Definition: hps.h:41457
virtual HPS::Type ObjectType() const
Definition: sprk.h:3445
Definition: sprk.h:2992
Definition: sprk.h:2497
Definition: hps.h:8619
HPS::Type ObjectType() const
Definition: sprk.h:937
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1091
Definition: hps.h:7302
Definition: sprk.h:2102
Definition: hps.h:33951
Definition: hps.h:339
Event * Clone() const
Definition: sprk.h:2844
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:901
Event * Clone() const
Definition: sprk.h:782
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:707
Definition: hps.h:8821
Definition: hps.h:10216
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1044
Definition: sprk.h:3221
Definition: sprk.h:2243
Mode
Definition: sprk.h:194
Definition: hps.h:506
Definition: sprk.h:968
Definition: hps.h:1122
Definition: hps.h:37684
Definition: sprk.h:794
Definition: sprk.h:2197
Definition: hps.h:36327
HPS::Type ObjectType() const
Definition: sprk.h:2619
HPS::Type ObjectType() const
Definition: sprk.h:2178
HPS::Type ObjectType() const
Definition: sprk.h:2672