Vous êtes sur la page 1sur 6

------------------------------------------------------------------------

--
-- (c) Copyright 1998 to Current Year AVEVA Solutions Limited
--
-- File: gph3ddesign.pmlfnc
-- Type: Function Definition
-- Group: Graphic View
-- Keyword: VIEW
-- Module: common
-- Replaces:
--
-- Author: N.Holmes
-- Created: Tue Jan 20 10:04:50 WAT 1998
--
-- Last modified by $Author: nrh $ on $Date: 2003/01/09 17:07:25 $
-- $Revision: 1.28 $
--
-- Description:
-- Standard Design Graphic View
--
------------------------------------------------------------------------
--
-- Function Type: Function/Procedure
-- Arguments:
-- [#] [R/RW] [Data Type] [Description]
-- 1 R REAL Form number
-- Return:
-- [Data Type] [Description]
-- FORM Form created
--
------------------------------------------------------------------------
-- Define function
define function !!gph3DDesign(!number is REAL) is FORM
-- Initialise Variables
!form = '!!gph3DDesign' & !number
!module = !!module()
-- Define form
setup form $!<form> resize DOCUMENT
$!<form>.formTitle = 'Default'
$!<form>.iconTitle = '3DView'
$!<form>.callback = ''
$!<form>.formRevision = ' $Revision: 1.28 $ '
$!<form>.cancelCall = '!!gphViews.close(' & !form & ')'
-- Body of form definition
-- Define Prompt
para .prompt at x0 ymax width 80 lines 1
-- New model editor view
if(!module.appName.lowcase() eq 'design') then
!volumeType = 'GIVolume'
!autoCeIcon = !!pml.getPathName('autocepopup16.png')
!rotateCeIcon = !!pml.getPathName('rotatece16.png')
!mouseZoomRectIcon = !!pml.getPathName('ng_zoomrectangle.png')
!mouseZoomInOutIcon = !!pml.getPathName('ng_zoominout.png')
!mouseRotateIcon = !!pml.getPathName('ng_rotatemode.png')
!mousePanIcon = !!pml.getPathName('ng_panmode.png')
!mouseWalkIcon = !!pml.getPathName('ng_walkmode.png')
!mouseWalkIconOff = !!pml.getPathName('ng_walkmode_off.png')
!restoreOneIcon = !!pml.getPathName('ng_restoreview1.png')
!restoreOneIconOff = !!pml.getPathName('ng_restoreview1_off.png')
!restoreTwoIcon = !!pml.getPathName('ng_restoreview2.png')
!restoreTwoIconOff = !!pml.getPathName('ng_restoreview2_off.png')
!restoreThreeIcon = !!pml.getPathName('ng_restoreview3.png')
!restoreThreeIconOff = !!pml.getPathName('ng_restoreview3_off.png')
!restoreFourIcon = !!pml.getPathName('ng_restoreview4.png')
!restoreFourIconOff = !!pml.getPathName('ng_restoreview4_off.png')
!zoomToCEIcon = !!pml.getPathName('ng_zoomtoce.png')
!zoomToIdentifyIcon = !!pml.getPathName('ng_zoomtoidentify.png')
!walkToDrawlistIcon = !!pml.getPathName('ng_zoomtodrawlist.png')
!zoomToSelectionIcon = !!pml.getPathName('ng_zoomtoselection.png')
!zoomToSelIconOff = !!pml.getPathName('ng_zoomtoselection_off.png')
!clippingIconOn = !!pml.getPathName('clippingicon_on16.png')
!clippingIconOff = !!pml.getPathName('clippingicon_off16.png')
!clipCE = !!pml.getPathName('clipce16.png')
--------------------------------------------------------------------------------
--------------------------------------------------
-- DO NOT ATTEMPT TO MODIFY THE NAMES OR DEFINITIONS OF ANY .core BUTTONS. THE
SE ARE CONTROLLED BY PDMS DESIGN CORE.
--------------------------------------------------------------------------------
--------------------------------------------------
-- define view control buttons
button .autoCE tooltip 'Limits CE & Options'
pixmap /$!<autoCeIcon> width 16 height 16 at x0 ymax+0.2 callba
ck |!!gphViews.limits(!this.view, !!ce)|
button .coreZoomToSelectionButton tooltip 'Zoom to Selection'
pixmap /$!<zoomToSelectionIcon> width 16 height 16 at xmin ymax
button .coreWalkToDrawlistButton tooltip 'Walk to Draw List'
pixmap /$!<walkToDrawlistIcon> width 16 height 16 at xmin ymax
button .coreCentreButton tooltip 'Centre on Selection'
pixmap /$!<rotateCeIcon> width 16 height 16 at xmin ymax callba
ck |!!gphViews.rotate(!this.view, !!ce.position)|
-- Middle mouse button view manipulation modes
button .coreZoomRectButton toggle tooltip 'Middle mouse button: Zoom Rect
angle' pixmap /$!<mouseZoomRectIcon> /$!<mouseZoomRectIcon>
width 16 height 16 at xmin ymax+0.3
button .coreZoomInOutButton toggle tooltip 'Middle mouse button: Zoom In/O
ut' pixmap /$!<mouseZoomInOutIcon> /$!<mouseZoomInOutIcon>
width 16 height 16 at xmin ymax
button .coreRotateButton toggle tooltip 'Middle mouse button: Rotate'
pixmap /$!<mouseRotateIcon> /$!<mouseRotateIcon>
width 16 height 16 at xmin ymax
button .corePanButton toggle tooltip 'Middle mouse button: Pan'
pixmap /$!<mousePanIcon> /$!<mousePanIcon>
width 16 height 16 at xmin ymax
button .coreWalkButton toggle tooltip 'Middle mouse button: Walkthrou
gh' pixmap /$!<mouseWalkIcon> /$!<mouseWalkIcon> /$!<mouseWalkIconOff>
width 16 height 16 at xmin ymax
button .clippingButton toggle tooltip 'Clipping & Options'
pixmap /$!<clippingIconOff> /$!<clippingIconOn>
width 16 height 16 at xmin ymax+0.3 callback |!!gphViews.cl
ipButton(|
button .clippingCE tooltip 'Clip CE'
pixmap /$!<clipCE> width 1
6 height 16 at xmin ymax callback |!!gphViews.clipboxElement(!this.view, !!C
E)|
-- View save and restore commands
button .coreRestoreView1Button tooltip 'Restore View 1' pixmap /$!<res
toreOneIcon> /$!<restoreOneIcon> /$!<restoreOneIconOff> width 16 heigh
t 16 at xmin ymax+0.3
button .coreRestoreView2Button tooltip 'Restore View 2' pixmap /$!<res
toreTwoIcon> /$!<restoreTwoIcon> /$!<restoreTwoIconOff> width 16 heigh
t 16 at xmin ymax
button .coreRestoreView3Button tooltip 'Restore View 3' pixmap /$!<res
toreThreeIcon> /$!<restoreThreeIcon> /$!<restoreThreeIconOff> width 16 heigh
t 16 at xmin ymax
button .coreRestoreView4Button tooltip 'Restore View 4' pixmap /$!<res
toreFourIcon> /$!<restoreFourIcon> /$!<restoreFourIconOff> width 16 heigh
t 16 at xmin ymax
-- Added by Simon Liddicott
button .newButton tooltip 'New button' pixmap /$!<restoreFourIcon> wid
th 16 height 16 at xmin ymax callback |$P new button|
-- Edit ends

-- Standard Graphic View


else
!volumeType = 'Volume'
!autoCeIcon = !!pml.getPathName('autoce16.png')
!rotateCeIcon = !!pml.getPathName('rotatece16.png')
!mouseZoomIcon = !!pml.getPathName('mousezoom16.png')
!mousePanIcon = !!pml.getPathName('mousepan16.png')
!mouseRotateIcon = !!pml.getPathName('mouserotate16.png')
!restoreOneIcon = !!pml.getPathName('restoreone16.png')
!restoreTwoIcon = !!pml.getPathName('restoretwo16.png')
!restoreThreeIcon = !!pml.getPathName('restorethree16.png')
!restoreFourIcon = !!pml.getPathName('restorefour16.png')
-- define view control buttons
button .autoCE tooltip 'Limits CE' pixmap /$!<autoCeIcon> width 16 height
16 at x0 ymax.prompt callback |!!gphViews.limits(!this.view, !!ce)|
button .rotateCE tooltip 'Rotate Origin CE' pixmap /$!<rotateCeIcon> width
16 height 16 at xmin ymax callback |!!gphViews.rotate(!this.view, !!ce.position
)|
button .mouseZoom tooltip 'Zoom' pixmap /$!<mouseZoomIcon> width 16 height
16 at xmin ymax+0.5 callback |!this.view.mouseMode = 'Zoom'|
button .mousePan tooltip 'Pan' pixmap /$!<mousePanIcon> width 16 height 16
at xmin ymax callback |!this.view.mouseMode = 'Pan'|
button .mouseRotate tooltip 'Rotate' pixmap /$!<mouseRotateIcon> width 16
height 16 at xmin ymax callback |!this.view.mouseMode = 'Rotate'|
button .restoreView1 tooltip 'Restore View 1' pixmap /$!<restoreOneIcon> w
idth 16 height 16 at xmin ymax+0.5 callback |!this.view.restoreView(1)|
button .restoreView2 tooltip 'Restore View 2' pixmap /$!<restoreTwoIcon> w
idth 16 height 16 at xmin ymax callback |!this.view.restoreView(2)|
button .restoreView3 tooltip 'Restore View 3' pixmap /$!<restoreThreeIcon>
width 16 height 16 at xmin ymax callback |!this.view.restoreView(3)|
button .restoreView4 tooltip 'Restore View 4' pixmap /$!<restoreFourIcon>
width 16 height 16 at xmin ymax callback |!this.view.restoreView(4)|
endif
-- Define graphics view
view .view at xmax+0.2 ymax.prompt prompt .prompt $!<volumeType>
width $!!gphViewOpt.width height $!!gphViewOpt.height
limits local s5000mm w5000mm d5000mm to n5000mm e5000mm u5000mm
-- Input Modes
-- Navigate
inmode create _navi type |DES_NAVIGATE|
-- Standard Element Pick
inmode create _pick type |DES_PICK|
-- Pick Any (Element, Ppoint, Pline)
inmode create _pAny type |DES_PICK_ANY|
-- Plines
inmode create _pLine type |DES_PICK_PLINE|
-- Ppoints
inmode create _point type |DES_PICK_POINT|
-- Screen Position
inmode create _screen type |DES_3D_LINE|
-- Default (Navigation)
inmode create _pickDetail type |DES_PICK_DETAIL|
-- Default (Navigation)
inmode create _default type |DES_NAVIGATE|
exit
-- Set Defaults for Modes
_view.navi.cursor = 'Pointer'
_view.navi.prompt = 'Navigate : '
_view.pick.cursor = 'Pointer'
_view.pick.prompt = 'Pick Element : '
_view.pAny.cursor = 'Pointer'
_view.pAny.prompt = 'Pick Any : '
_view.pLine.cursor = 'Pointer'
_view.pLine.prompt = 'Pick Pline : '
_view.point.cursor = 'Pick'
_view.point.prompt = 'Point Ppoint : '
_view.screen.cursor = 'Crosshair'
_view.screen.prompt = 'Pick 3D Position : '
_view.default.cursor = 'Pointer'
_view.default.prompt = 'Navigate : '
-- Form Members
-- Clip Data
member .clipbox is GPHCLIPBOX
-- Form Information
member .type is STRING
member .number is REAL
exit
-- End of form definition
-- Initialise Form Data
!formName = $!<form>
!formName.type = 'Design'
!formName.number = !number
!module = !!module()
-- start form maximised in MDI window
!formName.maximised = true
-- Assign defaults clipbox
!formName.clipbox.gphClipbox(!formName.view)
-- New model editor view
if(!module.appName.lowcase() eq 'design') then
!formName.newMenu('limitsMenu')
!formName.limitsMenu.add('CALLBACK', 'Obstruction', '!!gphViews.limitsList
(')
!formName.limitsMenu.add('CALLBACK', 'Clipbox', '!!gphViews.limitsBox(
')
!formName.limitsMenu.add('separator')
!formName.limitsMenu.add('CALLBACK', 'Restore', '!!gphViews.limitsRest
ore(')
!formName.limitsMenu.add('separator')
!formName.limitsMenu.add('CALLBACK', 'Explicit...', '!!gphViews.limitsExpl
icit(')
!formName.newMenu('lclippingMenu')
!formName.lclippingMenu.add('toggle', 'Enable', '!!gphViews.clipbox('
)
!formName.lclippingMenu.add('toggle', 'Capped', '!!gphViews.clipbox('
)
!formName.lclippingMenu.add('callback', 'Colour...', '!!gphViews.clipbox('
)
!formName.lclippingMenu.add('separator')
!formName.lclippingMenu.add('callback', 'CE', '!!gphViews.clipboxEl
ement(')
!formName.lclippingMenu.add('callback', 'Owner', '!!gphViews.clipboxEl
ement(')
!formName.lclippingMenu.add('callback', 'Limits Box', '!!gphViews.clipboxBo
x(')
!formName.lclippingMenu.add('callback', 'Pick item', '!!gphViews.clipboxPi
ck(')
!formName.lclippingMenu.add('separator')
!formName.lclippingMenu.add('callback', 'Pick limits', '!!gphViews.clipboxPi
ck(')
!formName.lclippingMenu.add('separator')
!formName.lclippingMenu.add('callback', 'Explicit...', '!!gphViews.clipboxEx
plicit(')
-- Assocuate limits menu with limits button
!formName.autoCE.setPopup(!formName.limitsMenu)
!formName.clippingButton.setPopup(!formName.lclippingMenu)
-- Standard Graphics View
else
-- build popup menus for restore/save view buttons
!formName.newMenu('saveView1')
!formName.saveView1.add('callback', 'Save 1', '!this.view.saveView(1)')
!formName.newMenu('saveView2')
!formName.saveView2.add('callback', 'Save 2', '!this.view.saveView(2)')
!formName.newMenu('saveView3')
!formName.saveView3.add('callback', 'Save 3', '!this.view.saveView(3)')
!formName.newMenu('saveView4')
!formName.saveView4.add('callback', 'Save 4', '!this.view.saveView(4)')
!formName.restoreView1.setPopup(!formName.saveView1)
!formName.restoreView2.setPopup(!formName.saveView2)
!formName.restoreView3.setPopup(!formName.saveView3)
!formName.restoreView4.setPopup(!formName.saveView4)
-- Load bar menus with standard pulldowns
!!gphViews.bar(!formName)
endif
-- Set defaults
!!gphViewOpt.applyToView(!formName.view)
return !formName
endfunction
-- End of function definition for !!gph3DDesign

Vous aimerez peut-être aussi