本文整理汇总了C++中CDrawingObject::Display方法的典型用法代码示例。如果您正苦于以下问题:C++ CDrawingObject::Display方法的具体用法?C++ CDrawingObject::Display怎么用?C++ CDrawingObject::Display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDrawingObject
的用法示例。
在下文中一共展示了CDrawingObject::Display方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Delete
// Remove an item from the drawing...
void CTinyCadDoc::Delete( drawingIterator it)
{
CDrawingObject *pointer = *it;
pointer->Display();
if (pointer == GetSelectable())
{
SetSelectable( NULL );
}
UnSelect(pointer);
MarkDeleteForUndo( *it );
delete *it;
m_drawing.erase( it );
SetModifiedFlag( TRUE );
}
示例3: SelectDelete
// Delete the selected objects!
void CTinyCadDoc::SelectDelete()
{
if (!IsSelected())
return;
CJunctionUtils j( this );
drawingIterator it = GetDrawingBegin();
while (it != GetDrawingEnd())
{
drawingIterator current = it;
++ it;
CDrawingObject *pointer = *current;
if (IsSelected( pointer ))
{
if (pointer == GetSelectable())
{
SetSelectable( NULL );
}
j.AddObjectToTodo( pointer );
MarkDeleteForUndo( pointer );
m_drawing.erase( current );
pointer->Display();
delete pointer;
}
}
m_selected.erase( m_selected.begin(), m_selected.end() );
// ... and perform the junction requirements...
j.CheckTodoList( true );
SetModifiedFlag( TRUE );
}
示例4: Redo
// Redo the last action
void CTinyCadDoc::Redo()
{
SetSelectable( NULL );
BOOL action_taken = FALSE;
// Is this possible?
while (CanRedo() && !action_taken)
{
m_undo_level ++;
// Re-apply all of the changes we have done at this level
CDocUndoSet &s = m_undo[ m_undo_level ];
// Go through the list of action and redo each one
//
CDocUndoSet::actionCollection::iterator act_it = s.m_actions.begin();
while (act_it != s.m_actions.end())
{
CDocUndoSet::CDocUndoAction &act = *act_it;
// Look up this item from the index...
drawingCollection::iterator it = m_drawing.begin();
int index = act.m_index;
while (index > 0 && it != m_drawing.end())
{
++ it;
-- index;
}
if (it != m_drawing.end())
{
(*it)->Display();
}
act.m_object->Display();
switch (act.m_action)
{
case CDocUndoSet::Deletion:
// We must re-delete the deleted objects
delete *it;
m_drawing.erase( it );
action_taken = TRUE;
break;
case CDocUndoSet::Addition:
// We must re-insert the additions
m_drawing.insert( it, Dup(act.m_object) );
action_taken = TRUE;
break;
case CDocUndoSet::Change:
// We convert the old objects into the new objects...
{
// Keep a copy for the redo...
CDrawingObject *copy = Dup(*it);
delete *it;
copy->Display();
*it = act.m_object;
act.m_object = copy;
}
action_taken = TRUE;
break;
}
++ act_it;
}
}
}