本文整理汇总了C++中CDrawingObject::IsConstruction方法的典型用法代码示例。如果您正苦于以下问题:C++ CDrawingObject::IsConstruction方法的具体用法?C++ CDrawingObject::IsConstruction怎么用?C++ CDrawingObject::IsConstruction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDrawingObject
的用法示例。
在下文中一共展示了CDrawingObject::IsConstruction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Select
// The object selection functions
// This selects objects in a box
// (We don't select construction objects)
void CTinyCadDoc::Select(CDPoint p1,CDPoint p2)
{
double left=min(p1.x,p2.x);
double right=max(p1.x,p2.x);
double top=min(p1.y,p2.y);
double bottom=max(p1.y,p2.y);
UnSelect();
drawingIterator it = GetDrawingBegin();
while (it != GetDrawingEnd())
{
CDrawingObject *obj = *it;
if ( obj->IsInside(left,right,top,bottom)
&& !obj->IsConstruction()
&&
(obj->GetType() != xJunction || !GetOption().GetAutoJunc() ) )
{
obj->Display();
Select( obj );
}
++ it;
}
}
示例2: OnDraw
//.........这里部分代码省略.........
COLORREF col = GetCurrentDocument()->GetOptions()->GetUserColor().Get(CUserColor::BACKGROUND);
dc.SelectBrush(col, 0);
dc.SelectPen(PS_SOLID, 1, col);
}
dc.Rectangle(CDRect(Start.x - 2, Start.y - 2, End.x + 2, End.y + 2));
dc.SelectBrush(cOFFPAGE);
dc.SelectPen(PS_SOLID, 1, cOFFPAGE);
if (End.x > GetCurrentDocument()->GetDetails().GetPageBoundsAsPoint().x)
{
CDPoint a = CDPoint(GetCurrentDocument()->GetDetails().GetPageBoundsAsPoint().x, 0);
dc.Rectangle(CDRect(a.x, a.y, End.x, End.y));
}
if (End.y > GetCurrentDocument()->GetDetails().GetPageBoundsAsPoint().y)
{
CDPoint a = CDPoint(Start.x, GetCurrentDocument()->GetDetails().GetPageBoundsAsPoint().y);
dc.Rectangle(CDRect(a.x, a.y, End.x, End.y));
}
if (Start.x < 0) dc.Rectangle(CDRect(0, Start.y, Start.x, End.y));
if (Start.y < 0) dc.Rectangle(CDRect(Start.x, 0, End.x, Start.y));
// Fill this region with a grid
double grid = GetCurrentDocument()->m_snap.GetGrid();
double SGrid = dc.GetTransform().doubleScale(grid);
if (GetCurrentDocument()->GetOptions()->ShowGrid() && SGrid > 10)
{
double x = dc.GetTransform().GetOrigin().x;
double y = dc.GetTransform().GetOrigin().y;
TransformSnap s = GetCurrentDocument()->m_snap;
s.SetGridSnap(TRUE);
x = s.Snap(x);
y = s.Snap(y);
for (double xp = x >= 0 ? x : 0; xp < End.x && xp < GetCurrentDocument()->GetDetails().GetPageBoundsAsPoint().x; xp += grid)
{
for (double yp = y >= 0 ? y : 0; yp < End.y && yp < GetCurrentDocument()->GetDetails().GetPageBoundsAsPoint().y; yp += grid)
{
dc.SetPixel(CDPoint(xp, yp), 0);
}
}
}
}
Start -= CDPoint(10, 10);
End += CDPoint(10, 10);
GetCurrentDocument()->GetSelectBegin();
drawingIterator it = GetCurrentDocument()->GetDrawingBegin();
while (it != GetCurrentDocument()->GetDrawingEnd())
{
CDrawingObject *obj = *it;
selected = !pDC->IsPrinting() && GetCurrentDocument()->IsSelected(obj);
paint_options options = selected ? draw_selected : draw_normal;
if (!pDC->IsPrinting() || !obj->IsConstruction())
{
if (pDC->IsPrinting() || obj->IsInside(Start.x, End.x, Start.y, End.y))
{
obj->Paint(dc, options);
}
}
++it;
}
// Now draw the selectable object, so it stands out...
CDrawingObject *obj = GetCurrentDocument()->GetSelectable();
if (obj != NULL && !GetCurrentDocument()->IsSelected(obj))
{
paint_options options = draw_selectable;
GetCurrentDocument()->GetSelectable()->Paint(dc, options);
}
// If only one item is selected then just draw its handles now
if (GetCurrentDocument()->IsSingleItemSelected())
{
GetCurrentDocument()->GetSingleSelectedItem()->PaintHandles(dc);
}
// if necessary turn back on the current object to be edited
if (GetCurrentDocument()->GetEdit() != NULL) {
//ATLTRACE2("TinyCadView::GetCurrentDocument->GetEdit->Paint(dc, draw_selected=%d)\n",draw_selected);
GetCurrentDocument()->GetEdit()->Paint(dc, draw_selected);
}
// Draw the design details
GetCurrentDocument()->Display(dc);
}
if (osb)
{
pDC->BitBlt(client.left, client.top, client.Width(), client.Height(), &BitmapDC, 0, 0, SRCCOPY);
BitmapDC.SelectObject(old_bitmap);
}
}
示例3: SaveXML
//-------------------------------------------------------------------------
void CTinyCadDoc::SaveXML(CXMLWriter &xml, drawingCollection &drawing, BOOL Details, BOOL SaveSelect, BOOL SaveResources )
{
// Write the objects to the file
try
{
xml.addTag(GetXMLTag());
// If necessary write the header stamp
if (Details)
{
xml.addTag(_T("NAME"));
xml.addChildData( m_sheet_name );
xml.closeTag();
xml.addTag(_T("DETAILS"));
m_oDetails.WriteXML( xml );
m_snap.SaveXML( xml );
xml.closeTag();
}
if (SaveResources)
{
// Find out which resources are in use
for( drawingIterator i = drawing.begin(); i != drawing.end(); i++ )
{
(*i)->TagResources();
}
// Save the resource details details
theOptions.SaveFontsXML(xml);
theOptions.SaveStylesXML(xml);
theOptions.SaveFillStylesXML(xml);
theOptions.SaveMetaFilesXML(xml);
}
// Only save the symbols if we are not saving
// to a library or the header...
if (Details)
{
theOptions.SaveSymbolsXML(xml);
}
if (Details)
{
theOptions.WriteXML( xml) ;
}
for( drawingIterator i = drawing.begin(); i != drawing.end(); i++ )
{
CDrawingObject* obj = *i;
if (obj->GetType() != xError
&& (Details || !obj->IsConstruction())
&& (!SaveSelect || IsSelected( obj )) )
{
// Now save the actual object data
obj->SaveXML(xml);
}
}
xml.closeTag();
}
catch ( CException *e)
{
// Could not save the file properly
e->ReportError();
e->Delete();
}
}