Camera Class |
Namespace: ABB.Robotics.RobotStudio.Stations
public sealed class Camera : ProjectObject
The Camera type exposes the following members.
Name | Description | |
---|---|---|
Attributes |
Returns a collection of dynamic attributes attached to the object
(Inherited from ProjectObject.) | |
Children |
Enumerates all child objects.
(Inherited from ProjectObject.) | |
ContainingProject |
Returns the Project that this object is a part of, or null if it is
not part of a Project.
(Inherited from ProjectObject.) | |
DisplayName |
Gets the name of the the object that should be displayed in the GUI.
(Inherited from ProjectObject.) | |
FieldOfView |
Gets or sets the field of view, in degrees
| |
FollowBehavior |
Gets or sets a value indicating how the camera will behave when it follows an object.
| |
FollowObject |
Gets or sets an object that the camera will follow.
| |
LockRotate |
Gets or sets a value (in radians) indicating how much the user is allowed to rotate the view.
A negative value disables rotate lock.
| |
LockTranslate |
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.
| |
LockZoom |
Gets or sets a value (in meters) indicating how much the user is allowed to zoom the view.
A negative value disables zoom lock.
| |
LookAt |
Gets or sets the point which will act as the center of the camera view.
| |
LookFrom |
Gets or sets the point of view of the camera.
| |
Name |
Gets or sets the name of the object
(Inherited from ProjectObject.) | |
Parent | (Overrides ProjectObjectParent.) | |
Projection |
Gets or sets a value indicating how 3D objects are projected.
| |
TypeDisplayName |
Gets a localized name for the type of this object.
(Inherited from ProjectObject.) | |
UIVisible |
Gets or sets a value that indicates if this object should be displayed in GUI
such as an object browser.
(Inherited from ProjectObject.) | |
UniqueId |
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.) | |
UpDirection |
Gets or sets the direction that corresponds to up on the screen.
| |
Visible |
Gets or sets a value indicating whether the camera will
be displayed in the graphics.
|
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
FindObjects |
Recursively finds object that satisfy a condition.
(Inherited from ProjectObject.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
SetView | ||
ToString | (Inherited from ProjectObject.) |
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(); }