com.esri.arcgis.geodatabase
Interface IRepresentation

All Superinterfaces:
Serializable
All Known Implementing Classes:
IRepresentationProxy, Representation

public interface IRepresentation
extends Serializable

Provides access to members that return and set properties of a representation.

Remarks

A feature representation is a feature enabled with representation capabilities. There are 3 different ways to create representations:

  1. Based on a Representation Rule (RuleID)
  2. Based on Overrides
  3. As free representation which is a graphic

Use IRepresentation interface to get a reference to the feature representation and modify its attributes.

RepresentationClass property can be used to get a reference to the feature class representation which the representation belongs to.

RuleID property is used to get or set the value for the representation rule present in the RuleID field which is then used to symbolize the feature representations. All representations converted to free representations will have the value of RuleID equal to -1.

How to convert a feature representation into a free representation which uses representation graphics for drawing:

  1. Create a new RepresentationGraphics object. Use esriDisplay.IRepresentationGraphics interface for this.
  2. Set this representation graphics object to the feature representation using Graphics property. This process will assign a value of -1 to the RuleID property which is significant to a free representation.
  3. Update the feature representation using UpdateFeature.
  4. Store the changes using IFeature::Store method.

Shape property returns a reference to the shape of the feature representation as geographic geometry. Use IMapContext::FromGeographyToMap method to convert geographic geometry to map context geometry.

Use ShapeEdit property to make edits to the shape, for example, to create a shape override. This property uses a copy of the shape object so, editing will not cause any change to the actual feature's shape but will do so in the copied object.

ShapeCopy is the property which creates a clone of the shape object. If you do not wish to use the clone then use ShapeEdit instead of this property.

UpdateFeature method must be called after a feature representation's attributes have been altered. In order to store the changes into the feature, IFeature::Store method must be used.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 IFeature getFeature()
          The feature associated with this representation.
 IRepresentationGraphics getGraphics()
          The Graphics object that describes the free representation.
 IMapContext getMapContext()
          Map context in which the representation is defined.
 IRepresentationClass getRepresentationClass()
          The representation class to which this representation belongs.
 int getRuleID()
          Rule ID.
 IGeometry getShape()
          Representation geometry.
 IGeometry getShapeCopy()
          Copy of the representation geometry.
 IGeometry getShapeEdit()
          Representation geometry.
 Object getValue(IGraphicAttributes attrs, int idx)
          The value of a representation property.
 boolean isHasShapeOverride()
          Indicates if the shape is overriden.
 void removeShapeOverride()
          Removes the shape override.
 void setGraphics(IRepresentationGraphics graphics)
          The Graphics object that describes the free representation.
 void setRuleID(int iD)
          Rule ID.
 void setShapeByRef(IGeometry shape)
          Representation geometry.
 void setValue(IGraphicAttributes attrs, int idx, Object val)
          The value of a representation property.
 void updateFeature()
          Updates the feature fields with the information contained in the representation.
 

Method Detail

getRepresentationClass

IRepresentationClass getRepresentationClass()
                                            throws IOException,
                                                   AutomationException
The representation class to which this representation belongs.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.geodatabase.IRepresentationClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFeature

IFeature getFeature()
                    throws IOException,
                           AutomationException
The feature associated with this representation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.geodatabase.IFeature
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapContext

IMapContext getMapContext()
                          throws IOException,
                                 AutomationException
Map context in which the representation is defined.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.display.IMapContext
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRuleID

int getRuleID()
              throws IOException,
                     AutomationException
Rule ID.

Remarks

Use RuleID property to change the representation rule for a feature representation. Setting this property to a different RuleID will not persist the change until UpdateFeature is called and the change for the feature is stored using IFeature::Store method.

If the RuleID does not exist in the collection of RepresentationRules object, then RuleID will return an esriRepresentationError (REP_E_INVALID_REP_RULE_ID).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The iD
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setRuleID

void setRuleID(int iD)
               throws IOException,
                      AutomationException
Rule ID.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
iD - The iD (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getShape

IGeometry getShape()
                   throws IOException,
                          AutomationException
Representation geometry.

Remarks

Shape property returns a reference to either the actual shape of the feature or the overriden shape of the representation depending on whether a shape override exists for the representation.

Use Shape property to create shape override which gets stored into the Override field. UpdateFeature and IFeature::Store methods must be called after the shape is altered to persist the changes.

If IRepresentationClass::RequireShapeOverride returns False then altering the shape of the feature representation will directly alter the feature's shape.

Note: It is necessary to set IRepresentationClass::RequireShapeOverride property to True, if you wish to store the shape overrides into Override field rather than altering the actual feature's shape.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.geometry.IGeometry
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getShapeEdit

IGeometry getShapeEdit()
                       throws IOException,
                              AutomationException
Representation geometry. This geometry can be a copy of the shape if the shape override option is active.

Remarks

ShapeEdit property returns a reference to the copy of either the shape of the feature or the overriden shape of the representation depending on whether a shape override exists for the representation. Use this property when you wish to edit the attributes of this object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.geometry.IGeometry
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getShapeCopy

IGeometry getShapeCopy()
                       throws IOException,
                              AutomationException
Copy of the representation geometry.

Remarks

ShapeCopy property returns a reference to the clone of either the shape of the feature or the overriden shape of the representation depending on whether a shape override exists for the representation. Use this property when you wish to edit the attributes of this object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.geometry.IGeometry
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setShapeByRef

void setShapeByRef(IGeometry shape)
                   throws IOException,
                          AutomationException
Representation geometry.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
shape - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isHasShapeOverride

boolean isHasShapeOverride()
                           throws IOException,
                                  AutomationException
Indicates if the shape is overriden.

Remarks

HasShapeOverride property will return True if the feature representation's shape property is overridden. To remove shape override, use RemoveShapeOverride property.

For removing other attribute overrides, use either IOverride::RemoveOverride or IOverride::RemoveOverrides method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The hasShapeOverride
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeShapeOverride

void removeShapeOverride()
                         throws IOException,
                                AutomationException
Removes the shape override.

Remarks

For removing other attribute overrides, use either IOverride::RemoveOverride or IOverride::RemoveOverrides method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGraphics

IRepresentationGraphics getGraphics()
                                    throws IOException,
                                           AutomationException
The Graphics object that describes the free representation.

Remarks

Use Graphics property to get or set a reference to the graphic object when representation is based on free representation. A free representation (Graphics) has a RepresentationRuleID value equal to -1. For all other representations, the RuleID value is a valid value and always greater than or equal to 1.

Graphics property will return an empty object when the representation is not based on free representation.

How to convert a feature representation into a free representation which uses Graphics for drawing:

  1. Create a new RepresentationGraphics object. Use esriDisplay.IRepresentationGraphics interface for this.
  2. Set this representation graphics object to the feature representation using Graphics property. This process will assign a value of -1 to the RuleID property which is significant to a free representation.
  3. Update the feature representation using UpdateFeature.
  4. Store the changes using IFeature::Store method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A reference to a com.esri.arcgis.display.IRepresentationGraphics
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setGraphics

void setGraphics(IRepresentationGraphics graphics)
                 throws IOException,
                        AutomationException
The Graphics object that describes the free representation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
graphics - A reference to a com.esri.arcgis.display.IRepresentationGraphics (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

updateFeature

void updateFeature()
                   throws IOException,
                          AutomationException
Updates the feature fields with the information contained in the representation.

Remarks

UpdateFeature method must be called after a feature representation's attributes have been altered. In order to store and persist the changes into the feature, IFeature::Store method must be called.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getValue

Object getValue(IGraphicAttributes attrs,
                int idx)
                throws IOException,
                       AutomationException
The value of a representation property.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
attrs - A reference to a com.esri.arcgis.display.IGraphicAttributes (in)
idx - The idx (in)
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setValue

void setValue(IGraphicAttributes attrs,
              int idx,
              Object val)
              throws IOException,
                     AutomationException
The value of a representation property.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
attrs - A reference to a com.esri.arcgis.display.IGraphicAttributes (in)
idx - The idx (in)
val - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.