//************************************************** wxRealPoint wxSFBotLineShape::GetSrcPoint() { wxRealPoint pt1, pt2; wxSFShapeBase* pSrcShape = GetShapeManager()->FindShape(m_nSrcShapeId); if( pSrcShape && !m_lstPoints.IsEmpty() ) { RealPointList::compatibility_iterator node = m_lstPoints.GetFirst(); if( node ) { pt1 = *node->GetData(); if(pSrcShape->IsKindOf(CLASSINFO(wxSFIfShape))) { wxSFIfShape *ifShape = (wxSFIfShape *)pSrcShape; if(GetCondition() == 1) return ifShape->GetBorderPoint(true); else return ifShape->GetBorderPoint(false); } else return wxRealPoint(pSrcShape->GetBoundingBox().x + pSrcShape->GetBoundingBox().GetWidth() / 2, pSrcShape->GetBoundingBox().GetBottom()); } } else { if( m_nMode != modeUNDERCONSTRUCTION ) GetDirectLine( pt1, pt2 ); else pt1 = wxRealPoint(pSrcShape->GetBoundingBox().x + pSrcShape->GetBoundingBox().GetWidth() / 2, pSrcShape->GetBoundingBox().GetBottom()); return pt1; } return wxRealPoint(); }
//************************************************** wxRealPoint wxSFBotLineShape::GetTrgPoint() { wxRealPoint pt1, pt2; wxSFShapeBase* pTrgShape = GetShapeManager()->FindShape(m_nTrgShapeId); if( pTrgShape && !m_lstPoints.IsEmpty() ) { RealPointList::compatibility_iterator node = m_lstPoints.GetLast(); if( node ) { pt2 = *node->GetData(); wxRect trgBB = pTrgShape->GetBoundingBox(); return wxRealPoint(trgBB.x + trgBB.GetWidth() / 2, trgBB.GetTop()); } } else { if( m_nMode != modeUNDERCONSTRUCTION ) GetDirectLine( pt1, pt2 ); else pt2 = Conv2RealPoint( m_nUnfinishedPoint ); return pt2; } return wxRealPoint(); }
wxString xsListRealPointPropIO::ToString(RealPointList value) { wxString out = wxT("[ "); RealPointList::compatibility_iterator node = value.GetFirst(); while( node ) { out << xsRealPointPropIO::ToString(*(wxRealPoint*)node->GetData()); if( node != value.GetLast() ) out << wxT(" | "); node = node->GetNext(); } out << wxT(" ]"); return out; }
void xsListRealPointPropIO::Write(xsProperty *property, wxXmlNode *target) { RealPointList *list = (RealPointList*)property->m_pSourceVariable; if(list->GetCount() > 0) { wxXmlNode *newNode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("property")); RealPointList::compatibility_iterator listNode = list->GetFirst(); while(listNode) { AddPropertyNode(newNode, wxT("item"), xsRealPointPropIO::ToString(*(wxRealPoint*)listNode->GetData())); listNode = listNode->GetNext(); } target->AddChild(newNode); AppendPropertyType(property, newNode); } }