#include <opcntr.h>
Inheritance diagram for RegenerateContourAction:
Public Member Functions | |
RegenerateContourAction () | |
Constructor for the action. | |
~RegenerateContourAction () | |
virtual ActionCode | Execute () |
Executes the action. Causes a regen of all bevels nodes in the action's list. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *pOp, ActionList *pActionList, List *pNodes, RegenerateContourAction **NewAction, BOOL bCache=FALSE) |
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation. | |
Protected Attributes | |
List * | m_pNodes |
BOOL | m_bCache |
DocRect | m_OldRect |
Definition at line 228 of file opcntr.h.
|
Constructor for the action.
Definition at line 1095 of file opcntr.cpp.
|
|
Definition at line 1247 of file opcntr.cpp. 01248 { 01249 if (m_pNodes) 01250 { 01251 m_pNodes->DeleteAll(); 01252 delete m_pNodes; 01253 } 01254 }
|
|
Executes the action. Causes a regen of all bevels nodes in the action's list.
Reimplemented from Action. Definition at line 1229 of file opcntr.cpp. 01230 { 01231 ActionCode Act; 01232 RegenerateContourAction* pAction; 01233 01234 Act = RegenerateContourAction::Init(pOperation, 01235 pOppositeActLst, 01236 m_pNodes, 01237 &pAction, 01238 m_bCache); 01239 01240 if (Act != AC_FAIL) 01241 { 01242 } 01243 01244 return Act; 01245 }
|
|
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.
Definition at line 1132 of file opcntr.cpp. 01137 { 01138 UINT32 ActSize = sizeof(RegenerateContourAction); 01139 01140 ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(RegenerateContourAction),(Action**)ppNewAction); 01141 01142 // make a copy of the node list 01143 List * pCopyList = NULL; 01144 ALLOC_WITH_FAIL(pCopyList, new List, pOp); 01145 NodeListItem * pItem = (NodeListItem *)pNodes->GetHead(); 01146 NodeListItem * pCopyItem = NULL; 01147 01148 while (pItem) 01149 { 01150 ALLOC_WITH_FAIL(pCopyItem, new NodeListItem, pOp); 01151 pCopyItem->pNode = pItem->pNode; 01152 01153 pCopyList->AddTail(pCopyItem); 01154 01155 pItem = (NodeListItem *)pNodes->GetNext(pItem); 01156 } 01157 01158 (*ppNewAction)->m_pNodes = pCopyList; 01159 (*ppNewAction)->m_bCache = bCache; 01160 01161 pItem = (NodeListItem *)pNodes->GetHead(); 01162 01163 DocView * pView = DocView::GetCurrent(); 01164 01165 Document * pDoc = Document::GetCurrent(); 01166 01167 DocRect dr; 01168 01169 if (Ac != AC_FAIL) 01170 { 01171 while (pItem) 01172 { 01173 if (pItem->pNode && !pItem->pNode->IsNodeHidden() && pItem->pNode->FindParent()!=NULL) 01174 { 01175 dr = dr.Union(((NodeRenderableBounded *)pItem->pNode)->GetBoundingRect()); 01176 01177 if (pView && bCache) 01178 { 01179 GetApplication()->AddNodeToRegenList(pItem->pNode); 01180 } 01181 else 01182 { 01183 ((NodeContourController *)(pItem->pNode))->RegenerateNode(NULL, FALSE); 01184 } 01185 01186 dr = dr.Union(((NodeRenderableBounded *)pItem->pNode)->GetBoundingRect()); 01187 } 01188 ((NodeRenderableInk*)pItem->pNode)->ReleaseCached(); 01189 01190 pItem = (NodeListItem *)pNodes->GetNext(pItem); 01191 } 01192 01193 if (pDoc) 01194 { 01195 if (Document::GetSelectedSpread()) 01196 { 01197 pDoc->ForceRedraw(Document::GetSelectedSpread(), 01198 dr); 01199 } 01200 } 01201 } 01202 01203 (*ppNewAction)->m_OldRect = dr; 01204 01205 // move my action to the head of the list 01206 // I have a problem, for certain ops we need to do the following, BUT for others 01207 // we don't (otherwise access violations occur). um? 01208 pActionList->RemoveItem(*ppNewAction); 01209 pActionList->AddHead(*ppNewAction); 01210 01211 return Ac; 01212 }
|
|
|
|
|
|
|