Click or drag to resize
Camera Class
Represents a camera that can be used to control the view of a GraphicControl.
Inheritance Hierarchy

Namespace:  ABB.Robotics.RobotStudio.Stations
Assembly:  ABB.Robotics.RobotStudio.Stations (in ABB.Robotics.RobotStudio.Stations.dll) Version: 7.0.8747.636
Syntax
C#
public sealed class Camera : ProjectObject

The Camera type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleCamera
Initializes a new instance of the Camera class.
Top
Properties
  NameDescription
Public propertyAttributes
Returns a collection of dynamic attributes attached to the object
(Inherited from ProjectObject.)
Public propertyChildren
Enumerates all child objects.
(Inherited from ProjectObject.)
Public propertyContainingProject
Returns the Project that this object is a part of, or null if it is not part of a Project.
(Inherited from ProjectObject.)
Public propertyDisplayName
Gets the name of the the object that should be displayed in the GUI.
(Inherited from ProjectObject.)
Public propertyFieldOfView
Gets or sets the field of view, in degrees
Public propertyCode exampleFollowBehavior
Gets or sets a value indicating how the camera will behave when it follows an object.
Public propertyCode exampleFollowObject
Gets or sets an object that the camera will follow.
Public propertyCode exampleLockRotate
Gets or sets a value (in radians) indicating how much the user is allowed to rotate the view. A negative value disables rotate lock.
Public propertyCode exampleLockTranslate
Gets or sets a value (in meters) indicating how much the user is allowed to translate (pan) the view. A negative value disables translate lock.
Public propertyCode exampleLockZoom
Gets or sets a value (in meters) indicating how much the user is allowed to zoom the view. A negative value disables zoom lock.
Public propertyCode exampleLookAt
Gets or sets the point which will act as the center of the camera view.
Public propertyCode exampleLookFrom
Gets or sets the point of view of the camera.
Public propertyName
Gets or sets the name of the object
(Inherited from ProjectObject.)
Public propertyParent (Overrides ProjectObjectParent.)
Public propertyCode exampleProjection
Gets or sets a value indicating how 3D objects are projected.
Public propertyTypeDisplayName
Gets a localized name for the type of this object.
(Inherited from ProjectObject.)
Public propertyUIVisible
Gets or sets a value that indicates if this object should be displayed in GUI such as an object browser.
(Inherited from ProjectObject.)
Public propertyUniqueId
Gets a persisted, globally unique identifier for this object, that can be used to find the object using the GetObjectFromUniqueId(String) method.
(Inherited from ProjectObject.)
Public propertyUpDirection
Gets or sets the direction that corresponds to up on the screen.
Public propertyCode exampleVisible
Gets or sets a value indicating whether the camera will be displayed in the graphics.
Top
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodFindObjects
Recursively finds object that satisfy a condition.
(Inherited from ProjectObject.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodSetView
Sets LookAt, LookFrom and UpDirection in one operation.
Public methodToString (Inherited from ProjectObject.)
Top
Examples
Camera Collection.
Camera Properties Example
Project.UndoContext.BeginUndoStep("CameraProperties");
try
{
    Station station = Station.ActiveStation;

    // Create a Camera.
    Camera myCam = new Camera();

    // Set the camera to look at a specific point.
    myCam.LookAt = new Vector3(0, 0, 0);

    // Set the camera to view from a specific point.
    myCam.LookFrom = new Vector3(10, 10, 10);

    // Fix the camera to this point.
    myCam.LockRotate = 0.0;
    myCam.LockTranslate = 0.0;
    myCam.LockZoom = 0.0;

    // Add it to the stations camera collection.
    station.Cameras.Add(myCam);

    // Sync the current view to the camera view.
    GraphicControl.ActiveGraphicControl.SyncCamera(myCam, true, 0);

    // Use the camera as the true camera.
    // This make sure that the constraints on the movement kicks in.
    GraphicControl.ActiveGraphicControl.Camera = myCam;

    // Unlock the view (negative values removes the locks).
    myCam.LockRotate = -1.0;
    myCam.LockTranslate = -1.0;
    myCam.LockZoom = -1.0;

    // Create a solid box to follow.
    Part myPart = new Part();
    station.GraphicComponents.Add(myPart);
    Body box = Body.CreateSolidBox(new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
    myPart.Bodies.Add(box);

    // Keep the direction in which the view of the box fixed.
    myCam.FollowBehavior = FollowObjectBehavior.FixDirection;

    // Follow the box.
    myCam.FollowObject = myPart;

    // Move the part in the GUI.
    // Observe how the part moves relative the floor,
    // but how the camera follows the part.
}
catch
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw;
}
finally
{
    Project.UndoContext.EndUndoStep();
}
Version Information

Supported in: 1.0.0.0
See Also