Documente online.
Zona de administrare documente. Fisierele tale
Am uitat parola x Creaza cont nou
 HomeExploreaza
upload
Upload




Parent Classes

autocad en


Parent Classes

This section describes the important parent classes used in the Standard Framework. Each class that users can implement will be inherited either from the parent classes or from one of their children.

The AcmStandard object contains the symbol-specific standard class (AcmDatumStd, AcmWeldingStd, and so on), and leader and arrowhead services.

Some of the symbol standards can have internal structure and/or internal services known just to the specific symbol. For example there is AcmCWeldService, which is used for different kinds of Weld sub-symbols.



The main responsibility of the symbol standard classes is to supply symbol graphics. These can be forwarded to the services.

The symbol standard class objects are associated with the appropriate symbols. The parameter object of the association, which is exchanged to maintain association, is inherited from AcmCSubSymbol.

AcmStandard

This is the base class for all standard classes in AutoCAD/M. This class is a container, holding objects for all symbol-specific classes. There is two-way ownership between AcmStandard and each symbol standard class. There are several classes contained in the AcmStandard class - AcmCArrowService classes and other symbol-related classes.

This class is inherited from AcDbObject.

Constructing

AcmStandard();

The constructor is protected.

virtual ~AcmStandard();

Initializing the Standard and its Symbol Standards

virtual Adesk::Boolean acmInit();

This function initializes the internal 20220x232u structure of the standard. This is a protected member function and is used for internal purposes only.

virtual Adesk::Boolean setFactoryDefaults();

This function is used to initialize the standard. It will create all necessary symbol standards that should be defined by the standard and save them to a drawing. If they already exist, it will reinitialize them to contain only "factory" settings.

Setting and Querying Data

Adesk::UInt16 classVersion() const;

This member function returns the class version, which is used to identify the versions of loaded classes. This can be used to convert older classes to current versions. The rule is that after loading the drawing to the newer release, the calls should be updated to contain the new version. This member function is protected.

LPCTSTR name() const;

Acm::ErrorStatus setName(LPCTSTR newName);virtual LPCTSTR originalName() const;

These member functions deal with the name of the standard. While this name can be a user-defined string and is saved in a drawing, the original Name is not saved in a drawing and is always a constant string expressing the original standard name - for example, ANSI.

LPCTSTR AcmStandard :: separator() const;

void AcmStandard :: setSeparator(LPCTSTR separator);

Sets or receives the string to be used as the separator of the fractional part of the number. It can be any character, but usually it is either " . " or " , ".

AutoCAD/M does not use the separator variable.

double scale() const;

void setScale(double scale);

Sets or receives the scale for any newly created symbol. This function doesn't affect symbols already created. In other words, if you use this function to change the scale of a new function, the changed scale does not affect symbols that have already been created.

Adesk::UInt16 symbolColor() const;

void setSymbolColor(Adesk::UInt16 color);

Sets or receives symbol color. Usually set to ByLayer, which means the symbol color is controlled by the layer setting. If symbol color is set to any other value, this value will override the layer setting.

Adesk::UInt16 leaderColor() const;

void setLeaderColor(Adesk::UInt16 color);

Sets or receives leader color. Leader color is usually set to ByLayer, which means the leader color is controlled by the layer setting. If it is set to any other value, this value will override the layer setting.

double arwScale() const;

void setArwScale(double scale);

Sets or receives arrowhead scale. Each arrowhead is drawn using scale= 1. This function is used to change the size for all symbol arrowheads used in drawing.

Acm::ArrowType arrowType() const;

Adesk::Boolean setArrowType(Acm::ArrowType type);

Sets or receives arrowhead type. The type is than used to draw any leader's arrowhead. The Leader can override this setting to use a different type of arrowhead. The list of possible arrowheads, as well as the default value, is controlled by each specific standard. See "Acm::ArrowType." The value kByStandard is saved in the leader by default. There are two new arrow types in this release (kArrowFilledHalf, kArrowEmptyHalf) used for ANSI-based section view arrowheads and for detail annotations. No change aside from recompiling and relinking is necessary for existing applications.

Adesk::UInt16 textColor() const;

void setTextColor(Adesk::UInt16 color);

Sets or receives the color used to draw any text in the symbol. Usually set to ByLayer, which means the color is controlled by the layer setting. If it is set to any other value, this value will override the layer setting.

double textHeight() const;

void setTextHeight(double);

Sets or receives the height of the text used in all symbols by default. The text height controls the symbol extents as well, because setting it bigger will produce a bigger symbol. It controls all text used in a symbol and can't be overridden.

AcDbObjectId textStyleId() const;

void setTextStyleId(const AcDbObjectId& id);

Sets or receives the AcDbObjectId of text style used to draw all text in the each symbol by default. The text style is usually created when calling setFactoryDefaults for the first time.

Adesk::Boolean isMetric() const;

Acm::ErrorStatus setIsMetric(Adesk::Boolean metric);

Sets or receives the status of the standard, specifying whether the standard should be considered inch-based or metric-based. An example of such a standard is ANSI, which exists in both variants. Each variant has different settings for text heights, line types and so on.

virtual void initToEditOriginal();

virtual void initToEdit()

These member functions are used to initialize standard before editing dialog is opened. They are intended for Autodesk's internal use and shouldn't be called from applications.

virtual Adesk::Boolean isOriginal() const;

Returns True if the standard isn't a user standard. The test is based on the standard name. If the standard name is equal to original name, then the function returns true.

virtual Acm::ErrorStatus onChangeUnits(Adesk::Boolean isMetric);

void makeArrowHeadAndCutLines(const AcmCLeader* pLeader, Adesk::Boolean cutLastLines, AcmCAuxEntArray&) const;

void makeNDD(const AcmCLeader* pLeader, AcmCAuxEntArray&) const;

These two member functions are intended for Autodesk's internal use and should not be called from an application.

Several new methods were added for this release:

Acm::ProjectionType projectionType() const;

void setProjectionType(Acm::ProjectionType);

Controls the projection type used for creating drawing views. It serves as the default value for the view creation process. Once the view is created and you change this value, the view is not updated.

Acm::ListInsertionPoint listInsertPoint() const;

void setListInsertPoint(Acm::ListInsertionPoint);

Controls the attachment type for several lists: parts lists, revision lists, hole charts, and so on. These lists may have their own symbol standards, which should update themselves if this value changes (use AcmStdReactor).

Acad::ErrorStatus replaceWith(AcDbObjectId otherStdId);

Used to replace one standard with another. If you use AutoCAD's swapIdWith without using replaceWith, the result is that AcmStandards are swapped, but their symbol standards are left untouched. The replaceWith method replaces and merges all symbol standards, so that no symbol is left behind without its standard.

virtual Acad::ErrorStatus subSwapIdWith(AcDbObjectId otherId, Adesk::Boolean swapXdata = false,

Adesk::Boolean swapExtDict = false);

Overridden virtual function necessary to properly support AutoCAD's swapIdWith.

General Leader Support

virtual void getSubEnts (const AcmCLeader* pLeader, AcmCAuxEntArray& entArray, Adesk::Boolean cutLastLines =Adesk::kTrue) const;

This is the main interface to leader support--it is the way that the standard supplies leader graphics. This function uses currently registered arrowhead services. Sub-entities are positioned at their World coordinates.

See also "Family of AcmCAuxEntities."

virtual void initArrowServices();

This protected member function constructs arrow services objects. It is usually called during the construction of a standard object. Users who want new arrowhead services must override this member function.

Adesk::Boolean registerArrowService(AcmCArrowService* pNewSrv);

This protected member function is used to register the service with the current standard.

AcmCArrowService* getArrowService(Acm::ArrowType type) const;

This protected member function is used to obtain the service object. See "AcmCArrowService" for information about its capabilities. Users don't need to use this function unless they want to reimplement getSubEnts. The standard keeps the ownership of the object. Users must not delete the returned pointer.

void walkThroughLeaderSeg(const AcmCLeaderNodeIterator* pIter,AcmCAuxEntArray& entArray,const AcmCLeader* pLeader,Adesk::Boolean cutLastLines =Adesk::kTrue, bool makeNdd = false) const;

This member function is intended for Autodesk's internal use and should not be called from an application.

Accessing Symbol Standard Objects

Acad::ErrorStatus newSymbolSupport(LPCTSTR parentClassName);

This function adds support for a new symbol. After calling this member function, users can add new standards, which will support new symbols. The parameter is the class name to be used to find common classes for all supporting symbol standards. For example, for the welding standard, the parameter is "AcmWeldingStd."

If the same class descriptor has already been added, this function returns the error code eDuplicateEntry.

Acad::ErrorStatus addSymbolStd(AcmSymbolStd* pStd, AcDbObjectId& symbolStdId, Adesk::Boolean setCurrent = Adesk::kTrue);

Adds a new symbol standard. This new symbol standard can be a revision (ANSI 1983 of FCF standard) or a completely new standard for a new symbol type (cutting section symbol, work center symbol). The class description of the added standard must already be known to the standard. In other words, before adding a new type of symbol standard, users must use the newSymbolSupport member function. The member function checks to see if the added standard is a different revision than the standards that already exist in a drawing. If not, it returns the error code eDuplicateEntry. It checks the getRevision results.

The boolean parameter setCurrent tells if the added symbol standard support should become current. If value is set to false, newly created symbols will continue using of the previously defined standard.

Acm::ErrorStatus getSymbolStd(LPCTSTR className, AcDbObjectIdArray& symbolStdId) const;

This is a more general member function used for getting a list of standards, which can be servers. The className is the name of the class from which the standard should be inherited. The first parameter must be the same as the one used to add symbol support. If the className is NULL, then all symbol standards will be returned.

Acm::ErrorStatus getCurrentStandards(AcDbObjectIdArray& symbolStdIdArray) const;

Returns the list of all current symbol standards. This function is often used to get a full list of symbols supported by the current standard. The returned objects can be opened and queried for revisions to be displayed in dialog boxes or reported to other targets.

Acm::ErrorStatus setCurrentSymbolStd(const AcDbObjectId& symbolStdId);

Acm::ErrorStatus getCurrentSymbolStd(LPCTSTR className,const AcDbObjectId& symbolStdId) const;

These two functions are used by the standard preference dialog to specify which standard is going to be the default for newly created symbols. The first parameter must be the same as the one used to add symbol support.

Acm::ErrorStatus getAllSymbolSupport(CStringArray& names) const;

Fills names with the list of all base class names of symbol standards, which are currently registered with the standard. For example it will contain "AcmWeldStd", "AcmSurfTextStd".

Acm::ErrorStatus getAllSymbolStd(AcDbObjectIdArray& idArray) const;

Fill idArray with the list of all registered symbol standards. It may contains more items than currently existing symbol set, because some of the symbols may have registered multiple standard supports.

Acm::ErrorStatus removeSymbolStd(const AcDbObjectId& stdId);

Erases the symbol standard and if it was the last support, it will remove symbol support itself and the symbol will not be instantiable anymore.

Dialog Support

virtual Adesk::Boolean getArrowDesc(AcmCObjArray<AcmCArrowDesc>& list,

Adesk::Boolean allSrv = Adesk::kTrue);

This function is used to get the list of all arrowheads or all standard-supported arrowheads. The AcmCArrowDesc class holds data necessary for dialog controls - usually list boxes.

See also "AcmCDesc."

virtual Acm::Visibility AcmStandard :: statusIsMetric() const;

virtual Acm::Visibility AcmStandard :: statusTextStyle() const;

virtual Acm::Visibility AcmStandard :: statusTextHeight() const;

These functions are used to get status for controls on the General page. The status is controlled by each particular standard. If users don't want to use metric controls, the standard should always return Acm::kHidden.

See also "Acm::Visibility."

Auxiliary

virtual void getTextHeightList(AcGeDoubleArray& lst) const;

Returns a list of all supported text heights that conform to the standard setting. Users should override this member function to get support for new standards.

void setProperties(AcDbMText& text);

Configures the AcDbMtext entity using standard settings - text style, color and height.

LPCTSTR textStyleName() const;

Acad::ErrorStatus setTextStyleName(LPCTSTR pName);

Used to handle text style using the text style's name.

AcmCArrowService

This is an abstract class. It defines the necessary interface for creating new arrowheads.

There are two main entry points from the AcmStandard object to these classes: registerArrowService and getArrowService. The developer uses the first one to register its own service. It is usually called during construction of a standard (for non-DBR services) or during filling in (for DBR services). Each service object contains back pointers to remove its references if this service is deleted. These services are used internally by getSubEnts for leaders to draw their arrowheads.

Private or protected member functions are for internal use only.

Constructing, Initialization and Service

virtual void getSubEnts(AcmCAuxEntArray& entArray) const;

Main interface to arrowhead service. All entities are positioned so that the arrowhead starts at the 0,0,0 position and usually has the direction as the x-axis.

See also "Family of AcmCAuxEntities"

Setting and Querying Data

virtual Acm::ArrowType serviceType() const;

Specifies the service internal identifier, for example Acm::kClosed30. If users want to create their own service types, they must override the initArrowSevices member function of the AcmStandard.

See also "Acm::ArrowType"

virtual Acm::ArrowGroup group() const;

virtual setGroup(Acm::ArrowGroup group) const;

Allows you to divide arrowhead services into the following groups: kAcadArrow, indicating the standard AutoCAD arrowhead, and kStandardArrow, indicating a special standard-based arrowhead.

See also "Acm::ArrowGroup"

Adesk::Boolean hidden() const;

void setHidden(Adesk::Boolean newVal);

Sets whether the arrow is hidden for the current standard.

virtual AcmCArrowDesc* getDesc();

Returns the descriptor object. This object can then be used in a dialog.

See also "AcmCDesc."

AcmSymbolStd

Inherited from AcDbObject. This class defines the common interface for any symbol standard. All its virtual member functions need to be overloaded to produce symbol-specific behavior. This class is not instantiable.

The AcmSubSymbol class is discussed in the Symbol-related classes.

Constructing and Services to Symbol

AcmSymbolStd();

virtual ~AcmSymbolStd();

Adesk::UInt16 classVersion() const;

This is the object version. It is tested during opening and if the number is bigger than the version defined by ACMSYMBB.ARX, the object is turned to a proxy. Then all commands will stop working.

virtual Adesk::Boolean isCompatibleTo(const AcmStandard* pStd) const;

This is the basic interface for the AcmStandardManager. It will determine whether AcmSymbolSTD can be used for a particular standard. This function is usually overloaded at the standard level. For an example, see AcmWeldingDIN. The standard manager calls this method (isCompatibleTo), passing the AcmStandard object. If that object is AcmStandardDIN, it will succeed. This is how the Standard manager determines if it is possible to add this symbol standard to the AcmStandardDIN object.

virtual Acm::ErrorStatus getRevision(CString& rev, Adesk::Int16& year) const;

This member function is called to get information about the standard name and revision. It can contain additional data in the string. This class implementation doesn't fill anything and returns eNotImplemented if is not overloaded in the child class.

AcmStandard * owner(AcDb::OpenMode mode = AcDb::kForRead) const;

Provides access to the parent standard. This function is usually used to get the text properties and other parameters. It opens the parent standard object for read and closes it when the object is closed. This member function should not be used. Users should use ownerId() and acedTansactionManager->getObject instead. If you really want to use it, it should be used for querying only.

virtual Acm::ErrorStatus onChangeUnits(Adesk::Boolean isMetric);

This member function is called on all symbol standards when their owner, the AcmStandard object, changes units from millimeters to inches or vice versa. It is a protected member function.

Initializing

virtual Acm::ErrorStatus cInit();

This class implementation doesn't do anything and returns eNotImplemented if it is not overloaded in the child class.

virtual Adesk::Boolean setFactoryDefaults();

Used to set factory default values. This function also sets and creates other necessary standard-dependent objects, such as text styles, hatch patterns and so on. It can be called AFTER an object has been added to the database. This class implementation does nothing and returns eNotImplemented if it is not overloaded in the child class.

Editing Support

Each individual symbol standard deals with symbol setting as well as with standard setting.

Standard Dialog

virtual Adesk::Boolean getTreeItems(AcmCObjPtrArray<CSymStdTreeItemDesc>& descArray) const;

This member function creates tree items, which are then used to initialize the user interface for editing this object. The object returned is then asked to provide services.

CSymStdTreeItemDesc

CsymStdTreeItemDesc::OnFactoryDefaults()

Supports finer granularity for applying factory defaults. It was added mainly for use with AcmCPartListStd and AcmCBalloonStd, but it can be used in any symbol standard that implements more than one symbol.

New member function added for this release: virtual BOOL OnFactoryDefaults(). If you use this class and have a standard (such as AcmSymbolStd) that contains more than one symbol standard (in this case AcmBOMStd and AcmCPartlistStd) you need to implement this interface to support editing of the contained standards.

virtual Acm::ErrorStatus getDescription(CString& desc, CBitmap*& pBmpLoaded, CBitmap*& pBmpReg, Adesk::Boolean& enablePref) const;

Returns the description of the symbol standard. It is then used to create a user interface, including bitmaps and strings. This function is usually overloaded at the symbol standard level, but not at the specific standard level. For example AcmWeldingStd will overload it, but AcmWeldingJIS won't.

virtual Acm::ErrorStatus initToEditOriginal();

virtual Acm::ErrorStatus initToEdit();

Initialization member functions. These will prepare the symbol standard to be edited as the original or non-original standard. These functions are called before editing. This class version does nothing and returns eNotImplemented.

AcmSymbol

Inherited from AcDbEntity. Most of the entity interface has been implemented. This class's primary responsibility is to hold and maintain the leader and provide a common environment for all symbols. Thus the class will hold the Imp object, hiding the data from the user. The class interface implements the basic AcDbEntity interface, which is extended to provide leader functionality, an interface for geometry associations through the leader, and symbol transformations.

Each specific symbol contains a sub-symbol, which is used for communicating with the standard.

Constructing and Initializing

AcmSymbol();

virtual ~AcmSymbol();

virtual Acm::ErrorStatus setSymbolDefaults( AcDbDatabase* pDb = NULL);

Use this overloaded member function to set up a symbol properly. The function mimics the setDatabaseDefaults() for standards. It will set up a default coordinate system (ECS) standard id. The inherited classes should override this member function to get proper initialization for their symbols.

Adesk::UInt16 classVersion() const;

This is object version. It is tested during opening and if the number is bigger than the version defined by ACMSYMBB.ARX, the object is turned to a proxy. Then all commands will stop working.

AcDbEntity and AcDbObject Interface

This class contains the common entity interface, which covers snap points, grip points, intersections, planes, drawing, and filling operations.

virtual Adesk::Boolean worldDraw(AcGiWorldDraw* pMode);

This member function queries the standard for sub-entities of the leader and then draws them. Then it queries sub-entities for all sub-symbols and draws them. Users don't need to override this member function unless they need special behavior. This function uses GS markers supplied by sub-symbols to draw the sub-symbols so that they can be used to access sub-entities in subsequent operations.

virtual Acad::ErrorStatus getGripPoints(AcGePoint3dArray&,

AcDbIntArray&,

AcDbIntArray&) const;

This member function queries all leaders for their grip points. Users don't need to override this member function unless they need to define new grips for sub-symbols.

virtual Acad::ErrorStatus moveGripPointsAt(const AcDbIntArray& indices, const AcGeVector3d&);

This member function will determine the leaders to which indices belong and apply moveGripPointsAt to them. If the tip point is being edited, then the leaderTipPointChanged() member function of the symbol will be called. If the leader contains a landing and it is changed, then the leaderLanding() member function of the symbol is called. Users need to override this member function if they define new grips. If the new symbol uses just a sub-symbol connected to a leader's tip, then it is not necessary to reimplement getGripPoints and moveGripPoints special behavior. For example, moving the tip's grip of the welding leader will change the origin of a connected welding symbol.

virtual Acad::ErrorStatus getStretchPoints(AcGePoint3dArray&) const;

Implemented by calling the getGripPoints member function. Users need to override this member function if they want special behavior.

virtual Acad::ErrorStatus moveStretchPointsAt(const AcDbIntArray& indices, const AcGeVector3d& offset);

Implemented by calling the moveGripPointsAt member function. Users need to override this member function if they want special behavior.

virtual Acad::ErrorStatus getOsnapPoints(AcDb::OsnapMode osnapMode,

int gsSelectionMark,

const AcGePoint3d& pickPoint,

const AcGePoint3d& lastPoint,

const AcGeMatrix3d& viewXform,

AcGePoint3dArray& snapPoints,

AcDbIntArray& geomIds) const;

This member function determines which sub-symbols or leaders belong to the GS marker. The function then asks for sub-entities and applies getOsnapPoints to them. Users need to override this member function if they want special behavior.

virtual Acad::ErrorStatus intersectWith(const AcDbEntity* ent,

AcDb::Intersect intType,

AcGePoint3dArray& points,

int thisGsMarker = 0,

int otherGsMarker = 0) const;

virtual Acad::ErrorStatus intersectWith(const AcDbEntity* ent,

AcDb::Intersect intType,

const AcGePlane& projPlane,

AcGePoint3dArray& points,

int thisGsMarker = 0,

int otherGsMarker = 0) const;

These member functions query all leaders to get their intersections with the specified entity. If it is a user-defined entity, it will be exploded first, and created entities will be resolved using the same member function.

Users need to override this member function if they want to implement intersections for particular sub-symbols as well.

virtual Acad::ErrorStatus explode(AcDbVoidPtrArray& entitySet) const;

Queries the standard for sub-entities for all leaders and then the server for all sub-entities for all sub-symbols. All sub-entities are then exploded. Users don't need to override this member function unless they need special functionality.

virtual Acad::ErrorStatus getGeomExtents(AcDbExtents& extents) const;

Sums geometry extents for a leader. Users need to override this member function to cover any defined sub-symbols.

virtual void list() const;

Lists all leaders including their vertices, standard name and original name, server name and version. Users need to override this member function if they want to list any other information contained in the sub-symbols.

virtual Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform);

This member function will apply transformBy to all leaders. Default implementation doesn't cover any smart behavior.

Users need to override this member function if they want special behavior.

virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);

virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;

virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);

virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;

These member functions are used to fill symbol data. They will fill leader and geometry references. Each particular symbol is responsible for filling all of its private data. During filling data from dwg, associated standard and symbol standard support is tested for proxies. If any of them appears to be a proxy, the symbol is also turned to a proxy.

Dxf filers are used for LISP processing only. Users cannot save standards or symbols to a DXF file.

virtual Acad::ErrorStatus decomposeForSave(AcDb::AcDbDwgVersion ver,AcDbObject*& replaceObj,

AcDbObjectId& replaceId,Adesk::Boolean& exchangeXData);

This is AutoCAD's main interface for saving older version files. Standards and symbols will be always saved as instances of anonymous blocks. This way users can use the graphic shape of symbols, but cannot use it later when loading the drawing to ACADM.

virtual Acad::ErrorStatus subErase(Adesk::Boolean erasing);

virtual Acad::ErrorStatus deepClone(AcDbObject* pOwnerObject,AcDbObject*& pClonedObject, AcDbIdMapping& idMap, Adesk::Boolean isPrimary = Adesk::kTrue) const;

virtual Acad::ErrorStatus wblockClone(AcRxObject* pOwner,AcDbObject*& pClonedObject, AcDbIdMapping& idMap, Adesk::Boolean isPrimary = Adesk::kTrue) const;

Geometry Reference

Geometry references are handled directly by leader or sub-symbol and thus are resolved at the specific symbol level. Here we just define the common interface to be overridden, if necessary. The default interface deals with just the first leader. If the symbol supports multiple leaders or the ability to attach sub-symbols, it must be resolved in each specific case.

Warning - this part of the interface might change in future releases of AutoCAD Mechanical.

Adesk::Boolean attachGeomRef(const void* pGeomRef,

const AcDbObjectId &viewId,

const AcGePoint3d &arrowheadLocation);

Adesk::Boolean attachGeomRef(const void* pGeomRef,

const AcGePoint3d &arrowheadLocation);

These functions attach a geometry reference. They return Adesk::kFalse if there is a geometry reference attached to the symbol already. In that case users need to use the leader iterator and specify more precisely to which arrowhead they want to attach the geometry. All input parameters are supplied by the system and thus their structure is hidden from users.

The version without the view Id is used to create the geometry association in model space. The void pointer is the pointer to the MCAD API geometry key.

Adesk::Boolean isAttached();

Returns kTrue if the symbol is attached to some geometry.

void detachGeomRef();

Detaches a geometry reference and frees it from memory. It forwards the call to the first leader, assuming it is the only part of the symbol that could be attached. In case specific sub-symbols could be attached as well, users must override this member function.

void releaseGeomRef();

GS Markers and Grip Points

It is important to have good control of GS Markers (GSMs) and grip points used in this class as well as in any successor. This is not common situation, since there are both of them at the AcmSymbol level and in any successor class. GSMs are defined for each leader segment. They are controlled by AcmStandard's getSubEnts. Each sub-entity has its own GSM, starting at 1. Each leader, no matter what its type, starts internally at the tip point. GSMs are used to get intersections and snap points. Any inherited class can use its own GSM.

virtual int numOfGsMarkers () const;

Returns the upper bound of GS Selection Markers (number of them) used by all leaders in this class. Sub-symbols are not taken into account. If users want to define GS markers for sub-symbols, they need to use a larger number than the return value.

virtual int numGripPoints() const;

Number of grip points used by this class. The class has grip points at each leader vertex.

Entity Coordinate System

This symbol uses a transformation matrix to transform the symbol body (excluding leader) from ECS to WCS. The symbols are always defined at the origin of ECS with the primary reference line (for welding and surface texture symbols) or a border (for FCF) lying on the X-axis of ECS.

virtual void setCoordSystem(const AcGePoint3d &origin,

const AcGeVector3d &normal,

const AcGeVector3d &xDir);

virtual void getCoordSystem(AcGePoint3d& origin,AcGeVector3d& xDir,AcGeVector3d& normal) const;

Resets the coordinate system used by the symbol. If it is changed, the whole symbol will be regenerated.

virtual AcGeVector3d xDir() const;

Returns the direction of the X-axis of the symbol's ECS in WCS. It is initialized when the symbol is created using the UCS setting. The symbol then preserves the x-axis setting.

virtual AcGeVector3d yDir() const;

Returns the direction of the Y-axis of symbol's ECS in WCS.

virtual AcGeVector3d normal() const;

Returns the normal of the defining plane.

AcGePoint3d origin() const;

void setOrigin(const AcGePoint3d& origin);

Returns or sets the origin of the defining plane.

Setting and Querying Data

virtual double scale() const;

virtual void setScale(double scale);

Sets or receives the scale factor for all sub-symbols (excluding leader). The default value is taken from the standard during getSymbolStandard. The symbol maintains its own scale. To reset the standard defined scale to a user-defined scale, open the standard, get the default scale and set it to the symbol.

Acad::ErrorStatus setStandardId(const AcDbObjectId& id);

AcDbObjectId standardId() const;

Used to set up the standard Id for the symbol. Returns the Id of the standard used to create the symbol.

AcDbObjectId serverId() const;

void setServerId(const AcDbObjectId& id);

Used to establish the connection to the server for a particular symbol. Standard Id is used for more general things like leader support; server Id is used to get sub-entities for a particular symbol.

Leader Support

There are supplementary virtual classes such as AcmCLeader, which is used to access leader and AcmCLeaderNodeIterator data, which in turn is used to access all detailed node information. The leader object is used to communicate with the standards as well.

The primary leader interface in the symbol is very simple - just the following member functions. All other data is accessible through the AcmCLeader class.

virtual Acm::ErrorStatus addLeader(const AcGePoint3dArray &ptrArray);

Creates a new leader using supplied points. If the function is not overloaded, it will create just a simple leader, which doesn't support landing and whose first segment is drawn up to the tip point.

AcmCLeader* getLeader(Adesk::UInt16 index = 0);

This member function is used to create the general leader interface. Index means index in the leader array. If the leader with the specified index doesn't exist, this function returns a NULL.

virtual Acm::ErrorStatus removeLeader(Adesk::UInt16 index);

Provides the method for removing the nth- leader in the list. If the leader doesn't exist, the function returns eInvalidInput.

int numOfLeaders() const;

Provides the number of leaders present in the symbol.

virtual void leaderTipPointChanged(const AcGeVector3d& offset, const AcmCLeader* leader);

virtual void leaderLandingChanged(const AcGeVector3d& offset, const AcmCLeader* leader);

These member functions are used to send a notification if the tip point or landing of the leader has changed. These member functions are usually overridden by symbols to react properly on grip editing the leader. If a leader supports landing, only leaderLandingChanged notification is sent even if the tip point changes as well.

Auxiliary

AcGeVector3d projectedVector(const AcGeVector3d& vec) const;

AcGePoint3d projectedPoint(const AcGePoint3d& pt) const;

Returns a WCS vector/point projected into XY plane of the symbol's ECS

virtual void regen();

This function is called during the updating of symbols that takes place when the standard is changed.

AcmCSubSymbol

This class is an abstract class. It defines the common interface for each sub-symbol class, which needs to be implemented to provide the same interface.

Basic Functionality

AcGePoint3d origin() const;

virtual void setOrigin(const AcGePoint3d &origin);

Sets or receives the origin of the symbol in WCS. It is usually driven by leader's tip point, so the container class might call the set member function when leader changes. Other geometry characteristics, such as normal, scale factor and x-axis, can be obtained from the symbol itself.

virtual LPCTSTR value(Acm::Variable var) const = 0;

virtual Acm::ErrorStatus getValue(Acm::Variable var, CSring& value) const;

virtual Acm::ErrorStatus setValue(Acm::Variable var, LPCTSTR newValue) const;

These function are used to set or obtain the value of any symbol variable. See also "Acm::Variable."

virtual Acm::Visibility variableStatus(Acm::Variable var) const;

virtual void setVariableStatus(Acm::Variable var, Acm::Visibility status);

Users can control the visibility of the editing controls. Each standard variable can be visible or editable for different kinds of standards. The Acm::Visibility status can be kHidden, kDisabled, kShaded, kSelectOnly, kVisible, where kDisabled, kShaded and kSelectOnly have the same meaning. These member functions should be called any time the variable value changes.

See also "Acm::Visibility," "Acm::Variable."

virtual Acm::ErrorStatus getVarDlgInfo(Acm::Variable var, CVarDlgInfo& v) const;

virtual Acm::ErrorStatus setVarDlgInfo(Acm::Variable var, const CVarDlgInfo& v);

These functions provide access to variable support data, such as the help index, dialog index, tooltip string, and label string.

See also "Acm::Variable."


Document Info


Accesari: 1697
Apreciat: hand-up

Comenteaza documentul:

Nu esti inregistrat
Trebuie sa fii utilizator inregistrat pentru a putea comenta


Creaza cont nou

A fost util?

Daca documentul a fost util si crezi ca merita
sa adaugi un link catre el la tine in site


in pagina web a site-ului tau.




eCoduri.com - coduri postale, contabile, CAEN sau bancare

Politica de confidentialitate | Termenii si conditii de utilizare




Copyright © Contact (SCRIGROUP Int. 2024 )