📄 dgnhelp.cpp
字号:
/****************************************************************************** * $Id: dgnhelp.cpp,v 1.12 2002/11/13 21:26:32 warmerda Exp $ * * Project: Microstation DGN Access Library * Purpose: Application visible helper functions for parsing DGN information. * Author: Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 2002, Avenza Systems Inc, http://www.avenza.com/ * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************** * * $Log: dgnhelp.cpp,v $ * Revision 1.12 2002/11/13 21:26:32 warmerda * added more documentation * * Revision 1.11 2002/11/12 19:44:17 warmerda * added view display * * Revision 1.10 2002/10/07 13:14:18 warmerda * added association id support * * Revision 1.9 2002/05/31 03:40:22 warmerda * added improved support for parsing attribute linkages * * Revision 1.8 2002/05/30 19:24:38 warmerda * add partial support for tag type 5 * * Revision 1.7 2002/04/22 20:44:41 warmerda * added (partial) cell library support * * Revision 1.6 2002/04/16 17:56:07 warmerda * Initialize ch. * * Revision 1.5 2002/03/14 21:38:05 warmerda * removed DGN_DEBUG macro * * Revision 1.4 2002/03/12 17:07:26 warmerda * added tagset and tag value element support * * Revision 1.3 2002/02/22 22:18:10 warmerda * ensure that multi-part attributes supported for fill info * * Revision 1.2 2002/01/15 06:42:30 warmerda * remove stub statement * * Revision 1.1 2002/01/15 06:38:02 warmerda * New * */#include "dgnlibp.h"CPL_CVSID("$Id: dgnhelp.cpp,v 1.12 2002/11/13 21:26:32 warmerda Exp $");static unsigned char abyDefaultPCT[256][3] = { {255,255,255}, {0,0,255}, {0,255,0}, {255,0,0}, {255,255,0}, {255,0,255}, {255,127,0}, {0,255,255}, {64,64,64}, {192,192,192}, {254,0,96}, {160,224,0}, {0,254,160}, {128,0,160}, {176,176,176}, {0,240,240}, {240,240,240}, {0,0,240}, {0,240,0}, {240,0,0}, {240,240,0}, {240,0,240}, {240,122,0}, {0,240,240}, {240,240,240}, {0,0,240}, {0,240,0}, {240,0,0}, {240,240,0}, {240,0,240}, {240,122,0}, {0,225,225}, {225,225,225}, {0,0,225}, {0,225,0}, {225,0,0}, {225,225,0}, {225,0,225}, {225,117,0}, {0,225,225}, {225,225,225}, {0,0,225}, {0,225,0}, {225,0,0}, {225,225,0}, {225,0,225}, {225,117,0}, {0,210,210}, {210,210,210}, {0,0,210}, {0,210,0}, {210,0,0}, {210,210,0}, {210,0,210}, {210,112,0}, {0,210,210}, {210,210,210}, {0,0,210}, {0,210,0}, {210,0,0}, {210,210,0}, {210,0,210}, {210,112,0}, {0,195,195}, {195,195,195}, {0,0,195}, {0,195,0}, {195,0,0}, {195,195,0}, {195,0,195}, {195,107,0}, {0,195,195}, {195,195,195}, {0,0,195}, {0,195,0}, {195,0,0}, {195,195,0}, {195,0,195}, {195,107,0}, {0,180,180}, {180,180,180}, {0,0,180}, {0,180,0}, {180,0,0}, {180,180,0}, {180,0,180}, {180,102,0}, {0,180,180}, {180,180,180}, {0,0,180}, {0,180,0}, {180,0,0}, {180,180,0}, {180,0,180}, {180,102,0}, {0,165,165}, {165,165,165}, {0,0,165}, {0,165,0}, {165,0,0}, {165,165,0}, {165,0,165}, {165,97,0}, {0,165,165}, {165,165,165}, {0,0,165}, {0,165,0}, {165,0,0}, {165,165,0}, {165,0,165}, {165,97,0}, {0,150,150}, {150,150,150}, {0,0,150}, {0,150,0}, {150,0,0}, {150,150,0}, {150,0,150}, {150,92,0}, {0,150,150}, {150,150,150}, {0,0,150}, {0,150,0}, {150,0,0}, {150,150,0}, {150,0,150}, {150,92,0}, {0,135,135}, {135,135,135}, {0,0,135}, {0,135,0}, {135,0,0}, {135,135,0}, {135,0,135}, {135,87,0}, {0,135,135}, {135,135,135}, {0,0,135}, {0,135,0}, {135,0,0}, {135,135,0}, {135,0,135}, {135,87,0}, {0,120,120}, {120,120,120}, {0,0,120}, {0,120,0}, {120,0,0}, {120,120,0}, {120,0,120}, {120,82,0}, {0,120,120}, {120,120,120}, {0,0,120}, {0,120,0}, {120,0,0}, {120,120,0}, {120,0,120}, {120,82,0}, {0,105,105}, {105,105,105}, {0,0,105}, {0,105,0}, {105,0,0}, {105,105,0}, {105,0,105}, {105,77,0}, {0,105,105}, {105,105,105}, {0,0,105}, {0,105,0}, {105,0,0}, {105,105,0}, {105,0,105}, {105,77,0}, {0,90,90}, {90,90,90}, {0,0,90}, {0,90,0}, {90,0,0}, {90,90,0}, {90,0,90}, {90,72,0}, {0,90,90}, {90,90,90}, {0,0,90}, {0,90,0}, {90,0,0}, {90,90,0}, {90,0,90}, {90,72,0}, {0,75,75}, {75,75,75}, {0,0,75}, {0,75,0}, {75,0,0}, {75,75,0}, {75,0,75}, {75,67,0}, {0,75,75}, {75,75,75}, {0,0,75}, {0,75,0}, {75,0,0}, {75,75,0}, {75,0,75}, {75,67,0}, {0,60,60}, {60,60,60}, {0,0,60}, {0,60,0}, {60,0,0}, {60,60,0}, {60,0,60}, {60,62,0}, {0,60,60}, {60,60,60}, {0,0,60}, {0,60,0}, {60,0,0}, {60,60,0}, {60,0,60}, {60,62,0}, {0,45,45}, {45,45,45}, {0,0,45}, {0,45,0}, {45,0,0}, {45,45,0}, {45,0,45}, {45,57,0}, {0,45,45}, {45,45,45}, {0,0,45}, {0,45,0}, {45,0,0}, {45,45,0}, {45,0,45}, {45,57,0}, {0,30,30}, {30,30,30}, {0,0,30}, {0,30,0}, {30,0,0}, {30,30,0}, {30,0,30}, {30,52,0}, {0,30,30}, {30,30,30}, {0,0,30}, {0,30,0}, {30,0,0}, {30,30,0}, {30,0,30}, {192,192,192}, {28,0,100}};/************************************************************************//* DGNLookupColor() *//************************************************************************//** * Translate color index into RGB values. * * If no color table has yet been encountered in the file a hard-coded * "default" color table will be used. This seems to be what Microstation * uses as a color table when there isn't one in a DGN file but I am not * absolutely convinced it is appropriate. * * @param hDGN the file. * @param color_index the color index to lookup. * @param red location to put red component. * @param green location to put green component. * @param blue location to put blue component. * * @return TRUE on success or FALSE on failure. May fail if color_index is * out of range. */int DGNLookupColor( DGNHandle hDGN, int color_index, int * red, int * green, int * blue ){ DGNInfo *psDGN = (DGNInfo *) hDGN; if( color_index < 0 || color_index > 255 ) return FALSE;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -