PSPin(3) pin connector subject, view,

Other Alias

PinComp, PinView, PinGraphic

SYNOPSIS

#include <Unidraw/Components/pin.h>

DESCRIPTION

PinComp is a Connector subclass that supports connectivity with zero degrees of freedom. It uses a PinGraphic to store its graphical attributes. PinView is a GraphicView for displaying the pin. PSPin is a PostScriptView that externalizes the subject's information in PostScript form.

SlidingPin and FixedPin are special rubberbands used to implement the animation effects that pins produce during direct manipulation. A SlidingPin is a circle with crosshairs (duplicating the appearance of a PinGraphic) that follows the mouse position, while a FixedPin draws a static circle with crosshairs.

PINCOMP PUBLIC OPERATIONS

PinComp(PinGraphic* = nil)
The constructor takes an optional PinGraphic that defines the pin's graphical attributes. The pad has fixed mobility initially
virtual void Interpret(Command*)
virtual void Uninterpret(Command*)
PinComp (un)interprets a subset of commands that connectors can generally interpret, namely MoveCmd, BrushCmd, AlignCmd, MobilityCmd, DeleteCmd, and CutCmd.
virtual Mobility GetMobility()
virtual void SetMobility(Mobility)
PinComp redefines these functions to return and assign its _mobility protected member. The pin has fixed mobility initially.
Pin* GetPin()
Return the Pin graphic that defines the line's attributes. GetPin is simply a more specific form of the GetGraphic operation.

PINVIEW PUBLIC OPERATIONS

PinView(PinComp* = nil)
Create an PinView, optionally supplying the subject.
virtual void Interpret(Command*)
PinView interprets AlignToGridCmd to align its lower left to the grid.
virtual Manipulator* CreateManipulator(
Viewer*, Event&, Transformer*, Tool*
)
virtual void InterpretManipulator(Manipulator*)
PinViews respond only to manipulation by GraphicCompTools, MoveTools, and ConnectTools. PinView inherits its MoveTool response from ConnectorView. GraphicCompTool will let the user place the pin at a particular position. Placement will be influenced by gravity, if any. PinView creates a ConnectManip in response to the ConnectTool, which will exhibit a gravational attraction to potential target connectors. PinView will produce a ConnectCmd to connect the pin to its target. A pin connected in this way will receive floating mobility.
PinComp* GetPinComp()
Return the subject.

PINVIEW PROTECTED OPERATIONS

PinGraphic* GetPin()
Return the PinGraphic that defines the pin's attributes. GetPin is simply a more specific form of the GetGraphic operation.
virtual PinComp* NewSubject(PinGraphic*)
A helper function that creates a PinComp subject with the given pin graphic. This function produces the proper subject when the GraphicCompTool's manipulator is interpreted. Subclasses can redefine this operation to return a PinComp subclass, thus eliminating the need to reimplement InterpretManipulator.
Manipulator* CreateGraphicCompManip(
Viewer*, Event&, Transformer*, Tool*
)
Manipulator* CreateConnectManip(
Viewer*, Event&, Transformer*, Tool*
)
Command* InterpretGraphicCompManip(Manipulator*)
Command* InterpretConnectManip(Manipulator*)
Helper functions used by CreateManipulator and InterpretManipulator to create and interpret the manipulators associated with GraphicCompTool and ConnectTool.

PINGRAPHIC PUBLIC OPERATIONS

PinGraphic(Coord = 0, Coord = 0, Graphic* = nil)
Create a PinGraphic, optionally specifying its center and a graphic from which to obtain its default graphics attributes.
void GetOriginal(Coord&, Coord&)
Return the PinGraphic's original center coordinates as specified in the constructor.

PSPIN PUBLIC OPERATIONS

PSPin(PinComp* = nil)
Construct a PostScript external representation of the given subject, if any.