# HG changeset patch # User Sebastien Jodogne # Date 1621509839 -7200 # Node ID 64dad1d7aca40dabc4ede38346afa6bb52faef56 # Parent 2c0497d61a5dacb951316afaa7bff71e2ea75cd9 renamed subclass diff -r 2c0497d61a5d -r 64dad1d7aca4 Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp --- a/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Thu May 20 12:05:15 2021 +0200 +++ b/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Thu May 20 13:23:59 2021 +0200 @@ -84,7 +84,7 @@ private: class Annotation; - class Primitive : public boost::noncopyable + class GeometricPrimitive : public boost::noncopyable { private: bool modified_; @@ -95,8 +95,8 @@ int depth_; public: - Primitive(Annotation& parentAnnotation, - int depth) : + GeometricPrimitive(Annotation& parentAnnotation, + int depth) : modified_(true), parentAnnotation_(parentAnnotation), color_(192, 192, 192), @@ -106,7 +106,7 @@ { } - virtual ~Primitive() + virtual ~GeometricPrimitive() { } @@ -186,10 +186,10 @@ class Annotation : public boost::noncopyable { private: - typedef std::list Primitives; + typedef std::list GeometricPrimitives; AnnotationsOverlay& that_; - Primitives primitives_; + GeometricPrimitives primitives_; public: Annotation(AnnotationsOverlay& that) : @@ -200,13 +200,13 @@ virtual ~Annotation() { - for (Primitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) + for (GeometricPrimitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) { that_.DeletePrimitive(*it); } } - Primitive* AddPrimitive(Primitive* primitive) + GeometricPrimitive* AddPrimitive(GeometricPrimitive* primitive) { if (primitive == NULL) { @@ -228,13 +228,13 @@ return *primitive; } - virtual void SignalMove(Primitive& primitive) = 0; + virtual void SignalMove(GeometricPrimitive& primitive) = 0; virtual void Serialize(Json::Value& target) = 0; }; - class Handle : public Primitive + class Handle : public GeometricPrimitive { private: ScenePoint2D center_; @@ -243,7 +243,7 @@ public: explicit Handle(Annotation& parentAnnotation, const ScenePoint2D& center) : - Primitive(parentAnnotation, 0), // Highest priority + GeometricPrimitive(parentAnnotation, 0), // Highest priority center_(center), delta_(0, 0) { @@ -328,7 +328,7 @@ }; - class Segment : public Primitive + class Segment : public GeometricPrimitive { private: ScenePoint2D p1_; @@ -339,7 +339,7 @@ Segment(Annotation& parentAnnotation, const ScenePoint2D& p1, const ScenePoint2D& p2) : - Primitive(parentAnnotation, 1), // Can only be selected if no handle matches + GeometricPrimitive(parentAnnotation, 1), // Can only be selected if no handle matches p1_(p1), p2_(p2), delta_(0, 0) @@ -414,7 +414,7 @@ }; - class Circle : public Primitive + class Circle : public GeometricPrimitive { private: ScenePoint2D p1_; @@ -424,7 +424,7 @@ Circle(Annotation& parentAnnotation, const ScenePoint2D& p1, const ScenePoint2D& p2) : - Primitive(parentAnnotation, 2), + GeometricPrimitive(parentAnnotation, 2), p1_(p1), p2_(p2) { @@ -504,7 +504,7 @@ }; - class Arc : public Primitive + class Arc : public GeometricPrimitive { private: ScenePoint2D start_; @@ -544,7 +544,7 @@ const ScenePoint2D& start, const ScenePoint2D& middle, const ScenePoint2D& end) : - Primitive(parentAnnotation, 2), + GeometricPrimitive(parentAnnotation, 2), start_(start), middle_(middle), end_(end), @@ -633,7 +633,7 @@ }; - class Text : public Primitive + class Text : public GeometricPrimitive { private: AnnotationsOverlay& that_; @@ -644,7 +644,7 @@ public: Text(AnnotationsOverlay& that, Annotation& parentAnnotation) : - Primitive(parentAnnotation, 2), + GeometricPrimitive(parentAnnotation, 2), that_(that), first_(true) { @@ -711,13 +711,13 @@ class EditPrimitiveTracker : public IFlexiblePointerTracker { private: - Primitive& primitive_; - ScenePoint2D sceneClick_; - AffineTransform2D canvasToScene_; - bool alive_; + GeometricPrimitive& primitive_; + ScenePoint2D sceneClick_; + AffineTransform2D canvasToScene_; + bool alive_; public: - EditPrimitiveTracker(Primitive& primitive, + EditPrimitiveTracker(GeometricPrimitive& primitive, const ScenePoint2D& sceneClick, const AffineTransform2D& canvasToScene) : primitive_(primitive), @@ -823,7 +823,7 @@ return handle2_; } - virtual void SignalMove(Primitive& primitive) ORTHANC_OVERRIDE + virtual void SignalMove(GeometricPrimitive& primitive) ORTHANC_OVERRIDE { if (&primitive == &handle1_ || &primitive == &handle2_) @@ -937,7 +937,7 @@ return endHandle_; } - virtual void SignalMove(Primitive& primitive) ORTHANC_OVERRIDE + virtual void SignalMove(GeometricPrimitive& primitive) ORTHANC_OVERRIDE { if (&primitive == &startHandle_) { @@ -1083,7 +1083,7 @@ return handle2_; } - virtual void SignalMove(Primitive& primitive) ORTHANC_OVERRIDE + virtual void SignalMove(GeometricPrimitive& primitive) ORTHANC_OVERRIDE { if (&primitive == &handle1_ || &primitive == &handle2_) @@ -1316,16 +1316,16 @@ }; - typedef std::set Primitives; - typedef std::set Annotations; - typedef std::set SubLayers; + typedef std::set GeometricPrimitives; + typedef std::set Annotations; + typedef std::set SubLayers; - Tool activeTool_; - size_t macroLayerIndex_; - size_t polylineSubLayer_; - Primitives primitives_; - Annotations annotations_; - SubLayers subLayersToRemove_; + Tool activeTool_; + size_t macroLayerIndex_; + size_t polylineSubLayer_; + GeometricPrimitives primitives_; + Annotations annotations_; + SubLayers subLayersToRemove_; void AddAnnotation(Annotation* annotation) { @@ -1344,7 +1344,7 @@ } } - void DeletePrimitive(Primitive* primitive) + void DeletePrimitive(GeometricPrimitive* primitive) { if (primitive != NULL) { @@ -1421,10 +1421,10 @@ std::unique_ptr polyline(new PolylineSceneLayer); - for (Primitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) + for (GeometricPrimitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) { assert(*it != NULL); - Primitive& primitive = **it; + GeometricPrimitive& primitive = **it; primitive.RenderPolylineLayer(*polyline, scene); @@ -1442,7 +1442,7 @@ { bool needsRefresh = false; - for (Primitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) + for (GeometricPrimitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) { assert(*it != NULL); if ((*it)->IsHover()) @@ -1468,7 +1468,7 @@ const ScenePoint2D s = p.Apply(scene.GetCanvasToSceneTransform()); - for (Primitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) + for (GeometricPrimitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) { assert(*it != NULL); bool hover = (*it)->IsHit(s, scene); @@ -1497,9 +1497,9 @@ { const ScenePoint2D s = p.Apply(scene.GetCanvasToSceneTransform()); - Primitive* bestHit = NULL; + GeometricPrimitive* bestHit = NULL; - for (Primitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) + for (GeometricPrimitives::iterator it = primitives_.begin(); it != primitives_.end(); ++it) { assert(*it != NULL); if ((*it)->IsHit(s, scene))