ViewWindows

Top  Previous  Next

The ViewWindow object displays the specified objects using one or more Viewpoints. The following object types can be visualized in a ViewWindow:

Spacecraft

GroundStation

CelestialObject

Formation

PointGroup

ProximityZone

Region

StarField

Vector

CoordinateSystem

RotatingLibrationPoint

GraphicsOverlay

WindowOverlay

BlockageDiagram

 

Once a ViewWindow has been configured, use the ViewWindow.Update() method or the Update command to display the window and refresh the contents. The epoch of the view is based on the epoch of the first Spacecraft in the view when Update is called. The View Output Properties interface allows you to modify object display settings and viewpoints at runtime through the FreeFlyer output screen. The View and Map commands provide much simpler alternatives to the ViewWindow object, with far fewer configuration options. For a complete list of the available options, see the ViewWindow properties and methods page.

 

For related information, see the other topics in this chapter: Vehicle 3D Models, Globe Layers, GraphicsOverlays, WindowOverlays, Generating Movies

 

 

Creating a ViewWindow


The script example below shows how to create a ViewWindow via FreeFlyer script, customize its window title, and turn off the star field. The script also demonstrates how to adjust the tail length and width of a Spacecraft and the projection height and label font of a GroundStation shown in the view. See the Viewpoints page for a sample of creating custom Viewpoints and adding them to a ViewWindow via FreeFlyer script.

 

// Create ViewWindow

ViewWindow ViewWindow1({Spacecraft1,GroundStation1});

 

You can add objects to a ViewWindow after it has been created using the following method:

 

// Add an object to the view

Region Region1;

ViewWindow1.AddObject(Region1);

 

You can control how any object is displayed using the various ViewWindow.Set* methods, such as ViewWindow.SetShowName(). A few examples are shown below. See the ViewWindow properties and methods page for a complete list of capabilities.

 

// Create ViewFont for GroundStation

ViewFont ViewFont1;

ViewFont1.Bold = 1;

 

 

// Customize object display settings

ViewWindow1.SetTailLength(Spacecraft1.ObjectId, 1000);

 

ViewWindow1.SetLineWidth(Spacecraft1.ObjectId, 1, 5);

 

ViewWindow1.SetProjectionHeight(GroundStation1.ObjectId, 700);

 

ViewWindow1.SetShowName(GroundStation1.ObjectId, 1);

 

ViewWindow1.SetObjectLabelFont(GroundStation1.ObjectId, ViewFont1);

 

ViewWindow1.SetShowIcon(Saturn.ObjectId, 1);

ViewWindow1.SetObjectIcon(Saturn.ObjectId, "saturn.png");

 

 

// Hide the built-in stars

ViewWindow1.SetShowObject(Stars.ObjectId, 0);

 

You can also create a ViewWindow through the Object Browser. The ViewWindow object editor Content page allows you to configure which objects to include in the view, and choose whether to display of each object. You can set whether to display the body, name, icon, history, grid, and/or axes of each object, depending on the applicable options. For GroundStation and Region objects, you can also set the projection height.

 

When displaying an object's history, you can set the history mode for the object tail to be "unlimited" or "wrapping." If the history mode is set to wrapping, you can set the tail length for the object, where the distance between each point in the tail depends on how much the epoch changes between ViewWindow updates.

 

 

 

ViewWindow Viewpoints


You can add any number of Viewpoints to a ViewWindow through FreeFlyer script or through the ViewWindow object editor. In the object editor (shown below), the first viewpoint in the list will be used as the default viewpoint. You can re-order the viewpoints by dragging them up and down within the list with your mouse. For detailed information on configuring custom Viewpoints from the ViewWindow object editor or via FreeFlyer script, see the Viewpoints page.

 

 

 

ViewWindow Properties


The Properties page of the ViewWindow object editor allows the user to set the window title and override several user preferences, such as lighting, textures, and status text.

 

 

You can control these ViewWindow properties through FreeFlyer script as well:

 

// Change ViewWindow default properties through FreeFlyer script

ViewWindow1.WindowTitle = "3D View of Spacecraft and GroundStation";

ViewWindow1.ShowStatusText = 0;

ViewWindow1.UseLighting = 0;

 

Note: For Mission Plans still using millisecond precision mode, the Properties page also lets you define the Update Mode of the ViewWindow. As of FreeFlyer 7.3, the default timing precision mode is nanosecond precision mode which provides more modern and robust interfaces for this functionality. See Object vs. Command Output for more information on the Update Mode and Target Display Mode.

 

 

Saving ViewWindow Configurations


You can query the display settings of the objects in a ViewWindow using Get methods, which correspond to the Set methods described above.

 

// Query the display settings for objects in the view

Report ViewWindow1.GetShowName(GroundStation1.ObjectId);

Report ViewWindow1.GetObjectIcon(Saturn.ObjectId);

 

Once a ViewWindow has been displayed using the Update command or ViewWindow.Update() method, you can modify the display settings for any object in the view through the View Output Properties interface. If you want to query the display settings after the user has potentially changed them through the output properties interface, you must first call the ViewWindow.Synchronize() method:

 

// Get most recent display settings that may have been modified by the user on the output screen

ViewWindow1.Synchronize();

 

// Query the display settings for objects in the view

Report ViewWindow1.GetShowName(GroundStation1.ObjectId);

Report ViewWindow1.GetObjectIcon(Saturn.ObjectId);

 

If you want to capture and save all of the display settings for every object in the ViewWindow, plus all of the viewpoints in the ViewWindow, you can use the ViewWindowConfiguration object. This lets you save the entire configuration of a view and import or export the configuration.

 

ViewWindowConfiguration config;

 

// Get most recent display settings that may have been modified by the user on the output screen

ViewWindow1.Synchronize();

 

// Capture the configuration

ViewWindow1.GetConfiguration(config);

 

// Save the configuration in an XML file

config.PutToFile("customDisplaySettings.xml");

 

Once you have captured a configuration and saved it to a file, you can import the configuration like so:

 

// Get the configuration from an XML file

config.GetFromFile("customDisplaySettings.xml");

 

// Apply the configuration to a ViewWindow

ViewWindow1.SetConfiguration(config);

 

View configurations can also be exported to the same XML file format through the Global page of the View Output Properties menu.

 

 

See Also


View Command

Map Command

Viewpoints

View Output Properties

Update Command

User Preferences

ViewWindow Properties and Methods