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*/343536/***********************************************************************37contour.h38***********************************************************************/39#define segDEBUG4041/* #define contour -100*/4243#define CONTOUR_float double44#define ACTIVE_poly_struct poly4546#define line_crosses_plane(z_min, z_max, z_val) \47((z_min < z_val) && (z_max >= z_val))4849#ifdef oldie50typedef struct _active_poly_struct {51struct _active_poly_struct *next;52int num;53struct _poly *polygon;54} active_poly_struct;55#endif5657typedef struct _segment_struct {58struct _segment_struct *next;59struct _viewTriple *point1, *point2;60} segment_struct;6162typedef struct _segment_list_struct {63int num_segs;64segment_struct *segments;65int num, max_num; /* num=slice num, max_num=#slices for this contour */66} segment_list_struct;6768/*=====================================================================*69Macro Definitions70*=====================================================================*/71#define foreach_slice(index, slice, slice_list, max_slices) \72for (index=0; \73(index<max_slices) && (int)(slice=(slice_list+index)); \74index++)75#define foreach_segment(seg, slice, fl) \76for (seg=slice->segments; (fl) && (seg != NIL(segment_struct)); seg=seg->next)7778#define foreach_segment_old(idx, s, sl, max, fl) \79for (idx=0; idx<max; idx++) \80for (s=(sl+idx)->segments; (fl) && (s != NIL(segment_struct)); s=s->next)8182/*---------------------------------------------------------------------*83interface stuff84*---------------------------------------------------------------------*/85#ifdef oldie86#define contourCursorForeground moColor(red1, light)87#define contourCursorBackground moColor(green0, normal)88#else89#define contourCursorForeground monoColor(68)90#define contourCursorBackground monoColor(197)91#endif9293#define contourMASK ExposureMask9495#define contourPlaneTextCOLOR 289697/*---------------------------------------------------*98title, dividing lines & stuff99*---------------------------------------------------*/100#define contourTitleColor moColor(blue0, normal)101#define contourTitleA 190102#define contourTitleB 217103104#define dotSize 8105#define dotExt 12106#define dotColor moColor(red2, pastel)107108/*---------------------------------------------------*109Button Positions & Dimensions110*---------------------------------------------------*/111#define contourPlaneXY_X 150112#define contourPlaneXY_Y 250113#define contourPlaneXZ_X 190114#define contourPlaneXZ_Y 250115#define contourPlaneYZ_X 230116#define contourPlaneYZ_Y 250117#define contourLittleButt_W 20118#define contourLittleButt_H 20119120#define contourFlatView_X 120121#define contourFlatView_Y 290122#define contourAppendSegs_X 120123#define contourAppendSegs_Y 320124#ifdef oldie125#define contourBigButt_W 170126#define contourBigButt_H 20127#else128#define contourBigButt_W 10129#define contourBigButt_H 10130#endif131/*---------------------------------------------------*132Line & button colors133*---------------------------------------------------*/134#define abort_FG moColor(red1, pastel)135#define return_FG moColor(green2, pastel)136#define littleButt_FG moColor(yellow0, pastel)137#define bigButt_FG moColor(orange1, pastel)138139/*---------------------------------------------------*140longitude part141*---------------------------------------------------*/142#define contourLongitude_X 10143#define contourLongitude_Y 55144#define contourLongitude_W 135145#define contourLongitude_H 120146147#define long_FG moColor(green1, normal)148#define long_corner_X 36149#define long_corner_Y 72150#define long_RADIUS 40151#define long_W (long_RADIUS<<1)152#define long_H (long_RADIUS<<1)153154#define long_center_X (long_corner_X + long_RADIUS)155#define long_center_Y (long_corner_Y + long_RADIUS)156157#define long_str_X 15158#define long_str_Y 48159160/*---------------------------------------------------*161latitude part162*---------------------------------------------------*/163#define contourLatitude_X 160164#define contourLatitude_Y 55165#define contourLatitude_W 135166#define contourLatitude_H 120167168#define lat_FG moColor(green1, normal)169#define lat_corner_X 130170#define lat_corner_Y 85171#define lat_RADIUS 60172#define lat_W (lat_RADIUS<<1)173#define lat_H (lat_RADIUS<<1)174#define lat_quad_X (lat_corner_X + lat_RADIUS)175#define lat_quad_Y (lat_corner_Y + lat_RADIUS)176177#define lat_str_X 176178#define lat_str_Y 48179180/*---------------------------------------------------*181slice part182*---------------------------------------------------*/183#define contourSliceNum_X 10184#define contourSliceNum_Y 245185#define contourSliceNum_W 90186#define contourSliceNum_H 115187188#define slice_FG moColor(red1, normal)189190#define slice_str_X 20191#define slice_str_Y 240192#define slicer_image_X 50193#define slicer_image_Y 253194195#define MAX_SLICES 100196197198199