open-axiom repository from github
/*1Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd.2All rights reserved.3Copyright (C) 2007-2008, Gabriel Dos Reis.4All rights reserved.56Redistribution and use in source and binary forms, with or without7modification, are permitted provided that the following conditions are8met:910- Redistributions of source code must retain the above copyright11notice, this list of conditions and the following disclaimer.1213- Redistributions in binary form must reproduce the above copyright14notice, this list of conditions and the following disclaimer in15the documentation and/or other materials provided with the16distribution.1718- Neither the name of The Numerical ALgorithms Group Ltd. nor the19names of its contributors may be used to endorse or promote products20derived from this software without specific prior written permission.2122THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS23IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED24TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A25PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER26OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,27EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,28PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR29PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF30LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING31NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS32SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.33*/3435/*#define rightLeft*/36#define leftRight37#define newStuff3839/******* Define's ********/40/*** box colors ***/41#define boxInline monoColor(140)42#define boxOutline monoColor(140)43#define clipBoxInline monoColor(148)44#define clipBoxOutline monoColor(148)4546#define lightB 20547#define lightPotA (control->buttonQueue[lightMoveZ].buttonY - 15)48#define lightPotB (control->buttonQueue[lightMoveZ].buttonY +\49control->buttonQueue[lightMoveZ].buttonHeight + 7)50#define lightTransL (control->buttonQueue[lightTranslucent].buttonX - 20)5152#define volumeTitleColor monoColor(77)53#define volumeTitleA 19054#define volumeTitleB 2175556#define volumeMASK ExposureMask5758#define frustrumColor monoColor(147)59#define frustrumX 3060#define frustrumY 2061#define frustrumLength 10062#define frustrumMidY 70 /* frustrumY + frustrumLength/2 */63#define frustrumBotY (frustrumY + frustrumLength)64#ifdef newStuff65#define frustrumMin (control->buttonQueue[frustrumBut].xHalf)66#define frustrumMax (frustrumMin + \67(control->buttonQueue[frustrumBut].xHalf))68#endif6970#define hitherColor monoColor(68) /* clipping plane */71#define hitherMinX (frustrumX + 5)72#define hitherMaxX (frustrumMin - 30)73#define hitherWinX (hitherMinX - 5)74#define hitherWinY (frustrumBotY + 10)75#define hitherWidth (hitherMaxX - hitherMinX + 10)76#define hitherHeight 2077#define hitherBarY (hitherWinY + 10) /* hitherWinY + hitherHeight/2 */7879#ifdef newStuff80#define eyeColor monoColor(131)81#define eyeMinX frustrumMin82#define eyeMaxX frustrumMax83#define eyeWinX (eyeMinX - 5)84#define eyeWinY hitherWinY85#define eyeWidth (eyeMaxX - eyeMinX + 10)86#define eyeHeight hitherHeight87#define eyeBarY hitherBarY88#endif8990#define volumeButtonColor monoColor(157)9192#define frustrumWindowX 3093#define frustrumWindowY 2894#define frustrumWindowWidth (controlWidth - 60)95#define frustrumWindowHeight (frustrumBotY + 40)9697/**** clip volume ****/98#define lengthFace 8099#ifdef rightLeft100#define backFaceX 190101#endif102#ifdef leftRight103#define backFaceX 33104#endif105#define backFaceY 255106#define deltaFace 25107#define zLength 35.355 /* sqrt(2*deltaFace^2) */108#ifdef rightLeft109#define frontFaceX (backFaceX - deltaFace)110#endif111#ifdef leftRight112#define frontFaceX (backFaceX + deltaFace)113#endif114#define frontFaceY (backFaceY + deltaFace)115116117#define majorAxis lengthFace /* size of the potentiometers */118#define minorAxis 20119#define midAxis 40120121#define clipXButX backFaceX122#define clipXButY (backFaceY-30)123124#ifdef rightLeft125#define clipYButX (frontFaceX - minorAxis - 10)126#endif127#ifdef leftRight128#define clipYButX (frontFaceX + lengthFace + 10)129#endif130#define clipYButY frontFaceY131132#ifdef rightLeft133#define clipZButX clipYButX /* align left side */134#endif135#ifdef leftRight136#define clipZButX (clipYButX+minorAxis-midAxis) /* align right side */137#endif138#define clipZButY clipXButY139140#define zFactor 0.6 /* ratio of clipZBut box & actual input area */141#define minDistXY 0.1 /* min distance between normalized clip faces */142#define minDistZ 0.06 /* 2/3 of XY */143144145#ifdef rightLeft146#define AA (clipZButX + midAxis)147#define BB clipZButY148#define CC backFaceX149#define DD backFaceY150#define EE frontFaceX151#define FF frontFaceY152#define clipZButTopEndX ((AA+BB+CC-DD)/2)153#define clipZButTopEndY ((AA+BB-CC+DD)/2)154#define clipZButBotEndX ((AA+BB+EE-FF)/2)155#define clipZButBotEndY ((AA+BB-EE+FF)/2)156#endif157158#ifdef leftRight159#define AA clipZButX160#define BB clipZButY161#define CC (backFaceX + majorAxis)162#define DD backFaceY163#define EE (frontFaceX + majorAxis)164#define FF frontFaceY165166#define clipZButTopEndX ((AA-BB+CC+DD)/2)167#define clipZButTopEndY ((BB-AA+CC+DD)/2)168#define clipZButBotEndX ((AA-BB+EE+FF)/2)169#define clipZButBotEndY ((BB-AA+EE+FF)/2)170#endif171172173