int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
virtual int GetNumberOfAttachments() const;
virtual bool AttachmentIsValid(int attachment) const;
+ virtual wxList& GetAttachments() { return m_attachmentPoints; }
// Only get the attachment position at the _edge_ of the shape, ignoring
// branching mode. This is used e.g. to indicate the edge of interest, not the point
// Rotate about the given axis by the given amount in radians.
virtual void Rotate(double x, double y, double theta);
- virtual inline double GetRotation() const { return m_rotation; }
+ virtual double GetRotation() const { return m_rotation; }
+ virtual void SetRotation(double rotation) { m_rotation = rotation; }
void ClearAttachments();
void Copy(wxShape& copy);
inline wxList *GetPoints() { return m_points; }
+ inline wxList *GetOriginalPoints() { return m_originalPoints; }
// Rotate about the given axis by the given amount in radians
virtual void Rotate(double x, double y, double theta);
+ double GetOriginalWidth() const { return m_originalWidth; }
+ double GetOriginalHeight() const { return m_originalHeight; }
+
+ void SetOriginalWidth(double w) { m_originalWidth = w; }
+ void SetOriginalHeight(double h) { m_originalHeight = h; }
+
private:
wxList* m_points;
wxList* m_originalPoints;
void OnDraw(wxDC& dc);
void SetSize(double x, double y, bool recursive = TRUE);
void SetCornerRadius(double rad); // If > 0, rounded corners
+ double GetCornerRadius() const { return m_cornerRadius; }
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
// Accessors
inline void SetText(const wxString& s)
- { m_regionText = s; m_formattedText.Append(new wxShapeTextLine(0,0,s));}
+ { m_regionText = s; }
void SetFont(wxFont *f);
void SetMinSize(double w, double h);
void SetSize(double w, double h);
void SetAlignmentType(bool isEnd, int alignType);
bool GetAlignmentOrientation(bool isEnd);
int GetAlignmentType(bool isEnd);
+ int GetAlignmentStart() const { return m_alignmentStart; }
+ int GetAlignmentEnd() const { return m_alignmentEnd; }
// Find next control point in line after the start/end point
// (depending on whether the node object is at start or end)
{
ClearPoints();
- m_originalPoints = the_points;
-
- // Duplicate the list of points
- m_points = new wxList;
-
- wxNode *node = the_points->GetFirst();
- while (node)
+ if (!the_points)
{
- wxRealPoint *point = (wxRealPoint *)node->GetData();
- wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
- m_points->Append((wxObject*) new_point);
- node = node->GetNext();
+ m_originalPoints = new wxList;
+ m_points = new wxList;
+ }
+ else
+ {
+ m_originalPoints = the_points;
+
+ // Duplicate the list of points
+ m_points = new wxList;
+
+ wxNode *node = the_points->GetFirst();
+ while (node)
+ {
+ wxRealPoint *point = (wxRealPoint *)node->GetData();
+ wxRealPoint *new_point = new wxRealPoint(point->x, point->y);
+ m_points->Append((wxObject*) new_point);
+ node = node->GetNext();
+ }
+ CalculateBoundingBox();
+ m_originalWidth = m_boundWidth;
+ m_originalHeight = m_boundHeight;
+ SetDefaultRegionSize();
}
- CalculateBoundingBox();
- m_originalWidth = m_boundWidth;
- m_originalHeight = m_boundHeight;
- SetDefaultRegionSize();
}
wxPolygonShape::~wxPolygonShape()