source: sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v4.00/Models_2D/GizmoCylinder_v40.ipf @ 272

Last change on this file since 272 was 272, checked in by srkline, 15 years ago

Version 6 pragma, remove unwanted Macro declaration

File size: 3.7 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma IgorVersion=6.0
3
4Macro ShowCylinderOrientation()
5        Gizmo1()
6end
7
8Window Gizmo1() : GizmoPlot
9        PauseUpdate; Silent 1   // Building Gizmo 6 window...
10
11        // Do nothing if the Gizmo XOP is not available.
12        if(exists("NewGizmo")!=4)
13                DoAlert 0, "Gizmo XOP must be installed"
14                return
15        endif
16
17        NewGizmo/N=ObjOrient/T="Object Orientation" /K=1 /W=(953,158,1318,524)
18        ModifyGizmo startRecMacro
19        AppendToGizmo Axes=CustomAxis,name=axes0
20        ModifyGizmo ModifyObject=axes0,property={0,axisRange,0,0,-1,0,0,1}
21        ModifyGizmo ModifyObject=axes0,property={0,lineWidth,15}
22        ModifyGizmo ModifyObject=axes0,property={0,axisScalingMode,1}
23        ModifyGizmo ModifyObject=axes0,property={0,axisColor,0,0,0,1}
24        ModifyGizmo ModifyObject=axes0,property={0,axisMinValue,-1}
25        ModifyGizmo ModifyObject=axes0,property={0,axisMaxValue,1}
26        AppendToGizmo Axes=boxAxes,name=axes1
27        ModifyGizmo ModifyObject=axes1,property={-1,axisMode,1}
28        ModifyGizmo ModifyObject=axes1,property={0,gridType,1}
29        ModifyGizmo ModifyObject=axes1,property={0,gridPlaneColor,0.719997,0.719997,0.719997,1}
30        ModifyGizmo ModifyObject=axes1,property={-1,axisScalingMode,1}
31        ModifyGizmo ModifyObject=axes1,property={-1,axisColor,0,0,0,1}
32        AppendToGizmo attribute color={0,0.244,1,1},name=color0
33        AppendToGizmo attribute ambient={1,1,1,1,1032},name=ambient0
34        ModifyGizmo setDisplayList=0, object=axes0
35        ModifyGizmo setDisplayList=1, object=axes1
36        ModifyGizmo SETQUATERNION={-0.105935,0.419811,0.039369,0.900544}
37        ModifyGizmo autoscaling=1
38        ModifyGizmo currentGroupObject=""
39        ModifyGizmo compile
40
41        ModifyGizmo bringToFront
42        ModifyGizmo hookFunction=GizmoRotationHook
43        ModifyGizmo showAxisCue=1
44        ModifyGizmo endRecMacro
45End
46
47
48
49// angles are input in degrees
50Macro ChangeAngle(theta,phi)
51        Variable theta,phi
52        Prompt theta,"THETA in degrees"
53        Prompt phi, "PHI in degrees"
54       
55        Variable dx,dy,dz
56       
57        theta = theta/360*2*pi
58        phi = phi/360*2*pi
59       
60        Print "theta, phi in radians = ",theta,phi
61       
62        dx = sin(theta)*cos(phi)
63        dy = sin(theta)*sin(phi)
64        dz = cos(theta)
65       
66        Print "Unit vector dx,dy,dz = ",dx,dy,dz
67        ModifyGizmo/N=ObjOrient ModifyObject=axes0,property={0,axisRange,-dx,-dy,-dz,dx,dy,dz}
68end
69
70//Window Gizmo0() : GizmoPlot
71//      PauseUpdate; Silent 1   // Building Gizmo 6 window...
72//
73//      // Do nothing if the Gizmo XOP is not available.
74//      if(exists("NewGizmo")!=4)
75//              DoAlert 0, "Gizmo XOP must be installed"
76//              return
77//      endif
78//
79//      NewGizmo/N=Gizmo0/T="Gizmo0" /W=(679,232,937,496)
80//      ModifyGizmo startRecMacro
81//      AppendToGizmo Axes=boxAxes,name=axes0
82//      ModifyGizmo ModifyObject=axes0,property={-1,axisMode,1}
83//      ModifyGizmo ModifyObject=axes0,property={0,gridType,1}
84//      ModifyGizmo ModifyObject=axes0,property={0,gridPlaneColor,0.719997,0.719997,0.719997,1}
85//      ModifyGizmo ModifyObject=axes0,property={-1,axisScalingMode,1}
86//      ModifyGizmo ModifyObject=axes0,property={-1,axisColor,0,0,0,1}
87//      AppendToGizmo cylinder={0.05,0.05,1,10,10},name=cylinder0
88//      AppendToGizmo attribute color={0,0.244,1,1},name=color0
89//      AppendToGizmo attribute ambient={1,1,1,1,1032},name=ambient0
90//      ModifyGizmo setDisplayList=0, object=axes0
91//      ModifyGizmo setDisplayList=1, opName=rotate0, operation=rotate, data={10,1,0,0}
92//      ModifyGizmo setDisplayList=2, opName=rotate1, operation=rotate, data={45,0,1,0}
93//      ModifyGizmo setDisplayList=3, opName=translate0, operation=translate, data={0,0,-0.5}
94//      ModifyGizmo setDisplayList=4, attribute=color0
95//      ModifyGizmo setDisplayList=5, object=cylinder0
96//      ModifyGizmo SETQUATERNION={-0.135609,0.238706,0.084163,0.957887}
97//      ModifyGizmo autoscaling=1
98//      ModifyGizmo currentGroupObject=""
99//      ModifyGizmo compile
100//
101//      ModifyGizmo showInfo
102//      ModifyGizmo infoWindow={156,382,646,561}
103//      ModifyGizmo bringToFront
104//      ModifyGizmo hookFunction=GizmoRotationHook
105//      ModifyGizmo showAxisCue=1
106//      ModifyGizmo endRecMacro
107//End
Note: See TracBrowser for help on using the repository browser.