1 /* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef TRANSFORM_SHAPES_BOX_H 10 #define TRANSFORM_SHAPES_BOX_H 11 12 #include "TransformBox.h" 13 14 class CanvasView; 15 class Shape; 16 17 class TransformShapesBox : public TransformBox { 18 public: 19 TransformShapesBox(CanvasView* view, 20 const Shape** objects, 21 int32 count); 22 virtual ~TransformShapesBox(); 23 24 // Observer interface (Manipulator is an Observer) 25 virtual void ObjectChanged(const Observable* object); 26 27 // TransformBox interface 28 virtual void Update(bool deep = true); 29 30 virtual void TransformFromCanvas(BPoint& point) const; 31 virtual void TransformToCanvas(BPoint& point) const; 32 virtual float ZoomLevel() const; 33 virtual double ViewSpaceRotation() const; 34 35 virtual TransformCommand* MakeCommand(const char* actionName, 36 uint32 nameIndex); 37 38 // TransformShapesBox 39 Command* Perform(); 40 Command* Cancel(); 41 42 Shape** Shapes() const 43 { return fShapes; } 44 int32 CountShapes() const 45 { return fCount; } 46 47 private: 48 CanvasView* fCanvasView; 49 50 Shape** fShapes; 51 int32 fCount; 52 53 // saves the transformable objects transformation states 54 // prior to this transformation 55 double* fOriginals; 56 57 Transformable fParentTransform; 58 }; 59 60 #endif // TRANSFORM_SHAPES_BOX_H 61 62