CPart.h

Includes:
"CConcreteObject.h"
"tinyxml2.h"
"CObjectID.h"
"TTool.h"

Introduction

Use the links in the table of contents to the left to access the documentation.



Classes

__Stacksmith__CPart__


Functions

SaveAssociatedResourcesToElement
UpdateMediaIDs

SaveAssociatedResourcesToElement


virtual void SaveAssociatedResourcesToElement(
    tinyxml2::XMLElement *inElement );
Discussion

If a part has associated resources, this is how we copy them when this part is copied. You'd likely call SaveMediaToElement() for whatever media you depend on, on your document's media cache.


UpdateMediaIDs


virtual void UpdateMediaIDs(
    std::map<ObjectID,ObjectID> changedIDMappings );
Discussion

When a part is pasted its associated media are pasted as well. If media uses an ID that already exists for a different item, it gets re-numbered. This function gets called in that case to let you fix up any IDs that may have changed. As the new number may collide with a later one, you get a list of all changed IDs at once, so subsequent ID changes don't cause your ID to be re-mapped again.


Typedefs

TGuidelineCallbackAction
THitPart

TGuidelineCallbackAction


typedef enum { 
    EGuidelineCallbackActionAddHorizontal,
    EGuidelineCallbackActionAddVertical,
    EGuidelineCallbackActionAddHorizontalSpacer,
    EGuidelineCallbackActionAddVerticalSpacer,
    EGuidelineCallbackActionClearAllForFilling,
    EGuidelineCallbackActionClearAllDone 
} TGuidelineCallbackAction;  
Fields
EGuidelineCallbackActionAddHorizontal

< Request to add a guideline at the given h coordinate.

EGuidelineCallbackActionAddVertical

< Request to add a guideline at the given v coordinate.

EGuidelineCallbackActionAddHorizontalSpacer

< Request to add a 'distance indicator' between the corrected coordinate and the given h coordinate.

EGuidelineCallbackActionAddVerticalSpacer

< Request to add a 'distance indicator' between the corrected coordinate and the given v coordinate.

EGuidelineCallbackActionClearAllForFilling

< Request to clear your list of guidelines in preparation for us calling you back with the new set. (don't redraw yet)

EGuidelineCallbackActionClearAllDone

< Request to clear your list of guidelines, we're done tracking. (redraw now)

Discussion

Indicate to the callback block how to display this coordinate.


THitPart


enum { 
    ENothingHitPart = 0,
    ELeftGrabberHitPart = (
        1 << 0),
    ETopGrabberHitPart = (
        1 << 1),
    ERightGrabberHitPart = (
        1 << 2),
    EBottomGrabberHitPart = (
        1 << 3),
    EContentHitPart = (
        ELeftGrabberHitPart | ETopGrabberHitPart | ERightGrabberHitPart | EBottomGrabberHitPart),
    EHorizontalMoveHitPart = (
        ELeftGrabberHitPart | ERightGrabberHitPart),
    EVerticalMoveHitPart = (
        ETopGrabberHitPart | EBottomGrabberHitPart),
    ECustomGrabberHitPart = (
        1 << 4) 
};  typedef uint32_t THitPart;  
Constants
ENothingHitPart

< Click was not on this object.

ELeftGrabberHitPart

< One of the left resize handles was clicked. If only bit set, it was the left center.

ETopGrabberHitPart

< Top resize handle was clicked. If only bit set, it was the top center.

ERightGrabberHitPart

< Right resize handle was clicked. If only bit set, it was the right center.

EBottomGrabberHitPart

< Bottom resize handle was clicked. If only bit set, it was the bottom center.

EContentHitPart

< No grab handle was clicked, but the click was inside the part's rectangle.

EHorizontalMoveHitPart

< Left & right == horizontal move with shift key.

EVerticalMoveHitPart

< Top & bottom == vertical move with shift key.

Discussion

Indicate which of the "resize handles" (aka "grabbers") have been clicked or are being moved right now.