File: SVEditTool.mesa
Last edited by Bier on August 5, 1985 1:24:35 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Contents: Produces container, menus and buttons for a Solidviews edit tool.
DIRECTORY
Commander,
Containers,
DisplayList3d,
FileNames,
Imager,
ImagerFont,
JaMSolidviews,
Rope,
Scratchpad2d,
SV2d,
SVArtworkTool,
SVEditToolMenus,
SVEditUser,
SVInterfaceTypes,
SVModelTypes,
SVRayTypes,
SVSceneTypes,
ViewerClasses,
ViewerOps;
SVEditTool: PROGRAM
IMPORTS Commander, Containers, DisplayList3d, FileNames, ImagerFont, JaMSolidviews, Scratchpad2d, SVArtworkTool, SVEditToolMenus, SVEditUser, ViewerOps
SHARES ViewerClasses -- to change rowsUsed of PRIVATE RECORD MenuRec -- =
BEGIN
Assembly: TYPE = SVSceneTypes.Assembly;
Color: TYPE = Imager.Color;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
CSGTree: TYPE = SVRayTypes.CSGTree;
MasterObject: TYPE = SVSceneTypes.MasterObject;
Point2d: TYPE = SV2d.Point2d;
Scene: TYPE = SVSceneTypes.Scene;
Viewer: TYPE = ViewerClasses.Viewer;
EditToolData: TYPE = REF EditToolDataObj;
EditToolDataObj: TYPE = SVInterfaceTypes.EditToolDataObj;
SphereSectionData: TYPE = SVInterfaceTypes.SphereSectionData;
BlockSectionData: TYPE = SVInterfaceTypes.BlockSectionData;
CylinderSectionData: TYPE = SVInterfaceTypes.CylinderSectionData;
ConeSectionData: TYPE = SVInterfaceTypes.ConeSectionData;
Declare the standard distances between menu lines.
entryHeight: CARDINAL = 12;-- height of a line of items
entryVSpace: CARDINAL = 3;-- vertical leading between lines
entryHSpace: CARDINAL = 8; -- horizontal space between items on a line
column0: CARDINAL = 0; -- horizontal space between margin and column 0;
column1: CARDINAL = 100; -- horizontal space between margin and column 1;
column2: CARDINAL = 200; -- horizontal space between margin and column 2.
column3: CARDINAL = 300; -- horizontal space between margin and column 3;
Init: PROC = {
Commander.Register[
key: "SolidViews",
proc: BuildTools,
doc: "Create a 3d graphics tool",
clientData: NIL
];
};
BuildTools: Commander.CommandProc = TRUSTED {
Create an edittool, a scratchpad, a solid viewer, and an artwork tool.
BuildTools is a Commander.CommandProc as required to register it with the Commander. It doesn't use its argument. It returns the name of the current Solidviews version.
editToolData: EditToolData ← NEW[EditToolDataObj];
Create an edittool (iconic and then open to take over right column).
Here we create the container.
editToolData.outer ← Containers.Create[[
name: "SolidViews EditTool",
iconic: TRUE,
column: right,
scrollable: TRUE
]];
editToolData.font ← ImagerFont.Find["Xerox/TiogaFonts/Helvetica12"];
editToolData.sceneSection.defaultScene ← DisplayList3d.CreateScene["DefaultScene"];
editToolData.sceneSection.currentScene ← editToolData.sceneSection.defaultScene;
editToolData.allViewers ← NIL;
editToolData.originalWorkingDirectory ← FileNames.CurrentWorkingDirectory[];
SVEditToolMenus.BuildCurrentSceneSection[editToolData];
SVEditToolMenus.BuildTextInputSection[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildDerivedTextSection[editToolData];
SVEditToolMenus.BuildAssemblyOpsSection[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildCompositeSection[editToolData];
SVEditToolMenus.BuildHalfSpaceSection[editToolData];
SVEditToolMenus.BuildSphereSection[editToolData];
SVEditToolMenus.BuildBlockSection[editToolData];
SVEditToolMenus.BuildCylinderSection[editToolData];
SVEditToolMenus.BuildConeSection[editToolData];
SVEditToolMenus.BuildTorusSection[editToolData];
SVEditToolMenus.BuildLinearSweepSection[editToolData];
SVEditToolMenus.BuildRevoluteSweepSection[editToolData];
SVEditToolMenus.BuildCopySection[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildTransformSection1[editToolData];
SVEditToolMenus.BuildTransformSection2[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildListingSection[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildCameraSection1[editToolData];
SVEditToolMenus.BuildCameraSection2[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildCameraOrderSection[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildShadowSection[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildArtworkSection[editToolData];
SVEditToolMenus.Build3DArtworkSection[editToolData];
SVEditToolMenus.BuildColorArtworkSection[editToolData];
SVEditToolMenus.BuildTubeArtworkSection[editToolData];
SVEditToolMenus.BuildBoxArtworkSection[editToolData];
SVEditToolMenus.BuildArtworkTransformSection[editToolData];
SVEditToolMenus.AddARule[editToolData];
SVEditToolMenus.BuildLightSourceSection[editToolData];
SVEditToolMenus.AddARule[editToolData];
Create a scratchpad (iconic).
[----, editToolData.scratchpad] ← Scratchpad2d.CreateScratchpad[editToolData.outer, editToolData];
Create an artwork tool (iconic).
editToolData.artworkTool ← SVArtworkTool.Create[paint: TRUE, editToolData: editToolData];
Show the edittool icon.
ViewerOps.PaintViewer[editToolData.outer, all];
Open the edittool icon to take over the whole column (closeOthers is TRUE).
ViewerOps.OpenIcon[editToolData.outer, TRUE, TRUE, TRUE];
Create a solid viewer (open).
SVEditUser.NewViewer[NIL, editToolData, red, FALSE, FALSE];
Tell the JaM interface where to find the most recent edittool.
JaMSolidviews.RegisterThisEditTool[editToolData];
Create a message typescript.
SVEditUser.NewOutput[NIL, editToolData, red, FALSE, FALSE];
Return the current solidviews version rope.
RETURN[NIL, DisplayList3d.versionRope];
}; -- end of BuildEditTool
Init[];
END.