/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "OdaCommon.h" #include "Ge/GeScale3d.h" #include "Ge/GeMatrix3d.h" #include "Ge/GeEllipArc3d.h" #include "Ge/GeEllipArc.h" #include "Ge/GePlane.h" #include "Ge/GeMatrix3d.h" #include "Ge/GeInterval.h" #include "Ge/GeCircArc3d.h" #include "Ge/GeLine3d.h" #include "Ge/GeLineSeg3d.h" #include "Ge/GeEllipArc2d.h" #include "Ge/GeExtents2d.h" #include "Ge/GeExtents3d.h" #include "Gi/GiWorldDraw.h" #include "DgCommandContext.h" #include "Ed/EdCommandStack.h" #include "StaticRxObject.h" #include "AbstractViewPE.h" #include "ColorMapping.h" #include "resource.h" #include "MaterialsEditor.h" #include "ColorPickerDlg.h" #include "DgGsManager.h" #include "ExDgnHostAppServices.h" #include "ExDgnServices.h" #include "DgGiContext.h" #include "SSet.h" #include "DgElementId.h" #include "DgElementIdArray.h" #include "Gs/Gs.h" #include "DgUserIO.h" #include "DgDatabase.h" #include "DgGsManager.h" #include "DgGiContext.h" #include "DgModel.h" #include "UInt8Array.h" #include "Gi/GiBaseVectorizer.h" #include "Gi/GiGeometrySimplifier.h" #include "Gi/GiPolyline.h" #include "Gs/GsModel.h" #include "DgTable.h" #include "DgLevelMask.h" #include "Gs/GsBaseVectorizer.h" #include "DgReferenceAttach.h" #include "DgSectionClip.h" #include "DgLight.h" #include "RxVariantValue.h" #include "DgGsManager.h" #include "OdaDgnApp.h" #include "OdaDgnAppVectorizer.h" #include "DgGsManager.h" #include "DgGiContext.h" /* -------------------------------------------------------------------------------------- */ /* ExTeapot custom entity */ /* -------------------------------------------------------------------------------------- */ #define EXTEAPOT_ENABLETEXCOORDS // TeapotBody data // Vertices static const double ExTeapotBodyVertices[363 * 3] = { 0.000000, 0.000000, 0.000000, 0.385396, 0.006445, 0.163976, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.296619, 0.006445, 0.296619, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.163976, 0.006445, 0.385396, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.006445, 0.417773, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.163976, 0.006445, 0.385396, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.296619, 0.006445, 0.296619, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.385396, 0.006445, 0.163976, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.417773, 0.006445, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.385396, 0.006445, -0.163976, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.296619, 0.006445, -0.296619, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.163976, 0.006445, -0.385396, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.006445, -0.417773, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.163976, 0.006445, -0.385396, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.296619, 0.006445, -0.296619, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.385396, 0.006445, -0.163976, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.417773, 0.006445, 0.000000, 0.000000, 0.000000, 0.000000, 0.385396, 0.006445, 0.163976, 0.000000, 0.000000, 0.000000, 0.417773, 0.006445, 0.000000, 0.592418, 0.023438, 0.252059, 0.455953, 0.023438, 0.455953, 0.296619, 0.006445, 0.296619, 0.000000, 0.000000, 0.000000, 0.642187, 0.023438, 0.000000, 0.676200, 0.047461, 0.287706, 0.520436, 0.047461, 0.520436, 0.287706, 0.047461, 0.676200, 0.252059, 0.023438, 0.592418, 0.163976, 0.006445, 0.385396, 0.000000, 0.000000, 0.000000, 0.733008, 0.047461, 0.000000, 0.691875, 0.075000, 0.294375, 0.532500, 0.075000, 0.532500, 0.294375, 0.075000, 0.691875, 0.000000, 0.075000, 0.750000, 0.000000, 0.047461, 0.733008, 0.000000, 0.023438, 0.642187, 0.750000, 0.075000, 0.000000, -0.294375, 0.075000, 0.691875, -0.287706, 0.047461, 0.676200, -0.252059, 0.023438, 0.592418, 0.000000, 0.006445, 0.417773, 0.000000, 0.000000, 0.000000, -0.532500, 0.075000, 0.532500, -0.520436, 0.047461, 0.520436, -0.455953, 0.023438, 0.455953, -0.163976, 0.006445, 0.385396, 0.000000, 0.000000, 0.000000, -0.691875, 0.075000, 0.294375, -0.676200, 0.047461, 0.287706, -0.592418, 0.023438, 0.252059, -0.296619, 0.006445, 0.296619, 0.000000, 0.000000, 0.000000, -0.750000, 0.075000, 0.000000, -0.733008, 0.047461, 0.000000, -0.642187, 0.023438, 0.000000, -0.385396, 0.006445, 0.163976, 0.000000, 0.000000, 0.000000, -0.417773, 0.006445, 0.000000, 0.000000, 0.000000, 0.000000, -0.385396, 0.006445, -0.163976, -0.417773, 0.006445, 0.000000, -0.592418, 0.023438, -0.252059, -0.455953, 0.023438, -0.455953, -0.296619, 0.006445, -0.296619, -0.642187, 0.023438, 0.000000, -0.676200, 0.047461, -0.287706, -0.520436, 0.047461, -0.520436, -0.287706, 0.047461, -0.676200, -0.252059, 0.023438, -0.592418, -0.163976, 0.006445, -0.385396, -0.733008, 0.047461, 0.000000, -0.691875, 0.075000, -0.294375, -0.532500, 0.075000, -0.532500, -0.294375, 0.075000, -0.691875, 0.000000, 0.075000, -0.750000, 0.000000, 0.047461, -0.733008, 0.000000, 0.023438, -0.642187, -0.750000, 0.075000, 0.000000, 0.294375, 0.075000, -0.691875, 0.287706, 0.047461, -0.676200, 0.252059, 0.023438, -0.592418, 0.000000, 0.006445, -0.417773, 0.532500, 0.075000, -0.532500, 0.520436, 0.047461, -0.520436, 0.455953, 0.023438, -0.455953, 0.163976, 0.006445, -0.385396, 0.691875, 0.075000, -0.294375, 0.676200, 0.047461, -0.287706, 0.592418, 0.023438, -0.252059, 0.296619, 0.006445, -0.296619, 0.750000, 0.075000, 0.000000, 0.733008, 0.047461, 0.000000, 0.642187, 0.023438, 0.000000, 0.385396, 0.006445, -0.163976, 0.417773, 0.006445, 0.000000, -0.691875, 0.075000, 0.294375, -0.789063, 0.117773, 0.000000, -0.750000, 0.075000, 0.000000, -0.727910, 0.117773, 0.309707, -0.875000, 0.192187, 0.000000, -0.807187, 0.192187, 0.343437, -0.960938, 0.301758, 0.000000, -0.886465, 0.301758, 0.377168, -1.000000, 0.450000, 0.000000, -0.532500, 0.075000, 0.532500, -0.560234, 0.117773, 0.560234, -0.621250, 0.192187, 0.621250, -0.682266, 0.301758, 0.682266, -0.922500, 0.450000, 0.392500, -0.978516, 0.625195, 0.000000, -0.902681, 0.625195, 0.384067, -0.921875, 0.810938, 0.000000, -0.294375, 0.075000, 0.691875, -0.309707, 0.117773, 0.727910, -0.343437, 0.192187, 0.807187, -0.377168, 0.301758, 0.886465, -0.710000, 0.450000, 0.710000, -0.694746, 0.625195, 0.694746, -0.850430, 0.810938, 0.361836, -0.841797, 1.003711, 0.000000, 0.000000, 0.075000, 0.750000, 0.000000, 0.117773, 0.789063, 0.000000, 0.192187, 0.875000, 0.000000, 0.301758, 0.960938, -0.392500, 0.450000, 0.922500, -0.384067, 0.625195, 0.902681, -0.654531, 0.810938, 0.654531, 0.294375, 0.075000, 0.691875, 0.309707, 0.117773, 0.727910, 0.343437, 0.192187, 0.807187, 0.377168, 0.301758, 0.886465, 0.000000, 0.450000, 1.000000, 0.000000, 0.625195, 0.978516, -0.361836, 0.810938, 0.850430, 0.532500, 0.075000, 0.532500, 0.560234, 0.117773, 0.560234, 0.621250, 0.192187, 0.621250, 0.682266, 0.301758, 0.682266, 0.392500, 0.450000, 0.922500, 0.384067, 0.625195, 0.902681, 0.000000, 0.810938, 0.921875, 0.691875, 0.075000, 0.294375, 0.727910, 0.117773, 0.309707, 0.807187, 0.192187, 0.343437, 0.886465, 0.301758, 0.377168, 0.710000, 0.450000, 0.710000, 0.694746, 0.625195, 0.694746, 0.361836, 0.810938, 0.850430, 0.750000, 0.075000, 0.000000, 0.789063, 0.117773, 0.000000, 0.875000, 0.192187, 0.000000, 0.960938, 0.301758, 0.000000, 0.922500, 0.450000, 0.392500, 0.902681, 0.625195, 0.384067, 0.654531, 0.810938, 0.654531, 0.330405, 1.003711, 0.776558, 0.000000, 1.003711, 0.841797, 1.000000, 0.450000, 0.000000, 0.978516, 0.625195, 0.000000, 0.850430, 0.810938, 0.361836, 0.597676, 1.003711, 0.597676, 0.294375, 1.200000, 0.691875, 0.000000, 1.200000, 0.750000, -0.294375, 1.200000, 0.691875, -0.330405, 1.003711, 0.776558, 0.921875, 0.810938, 0.000000, 0.776558, 1.003711, 0.330405, 0.532500, 1.200000, 0.532500, 0.284409, 1.236914, 0.668452, 0.000000, 1.236914, 0.724609, -0.284409, 1.236914, 0.668452, 0.841797, 1.003711, 0.000000, 0.691875, 1.200000, 0.294375, 0.514473, 1.236914, 0.514473, 0.275363, 1.249219, 0.647191, 0.000000, 1.249219, 0.701563, -0.275363, 1.249219, 0.647191, 0.750000, 1.200000, 0.000000, 0.668452, 1.236914, 0.284409, 0.498109, 1.249219, 0.498109, 0.270917, 1.236914, 0.636741, 0.000000, 1.236914, 0.690234, -0.270917, 1.236914, 0.636741, 0.724609, 1.236914, 0.000000, 0.647191, 1.249219, 0.275363, 0.490066, 1.236914, 0.490066, 0.274750, 1.200000, 0.645750, 0.000000, 1.200000, 0.700000, -0.274750, 1.200000, 0.645750, 0.701563, 1.249219, 0.000000, 0.636741, 1.236914, 0.270917, 0.497000, 1.200000, 0.497000, 0.690234, 1.236914, 0.000000, 0.645750, 1.200000, 0.274750, 0.700000, 1.200000, 0.000000, -0.497000, 1.200000, 0.497000, -0.490066, 1.236914, 0.490066, -0.498109, 1.249219, 0.498109, -0.514473, 1.236914, 0.514473, -0.645750, 1.200000, 0.274750, -0.636741, 1.236914, 0.270917, -0.647191, 1.249219, 0.275363, -0.668452, 1.236914, 0.284409, -0.532500, 1.200000, 0.532500, -0.597676, 1.003711, 0.597676, -0.700000, 1.200000, 0.000000, -0.690234, 1.236914, 0.000000, -0.701563, 1.249219, 0.000000, -0.724609, 1.236914, 0.000000, -0.691875, 1.200000, 0.294375, -0.776558, 1.003711, 0.330405, -0.750000, 1.200000, 0.000000, 0.691875, 0.075000, -0.294375, 0.789063, 0.117773, 0.000000, 0.750000, 0.075000, 0.000000, 0.727910, 0.117773, -0.309707, 0.875000, 0.192187, 0.000000, 0.807187, 0.192187, -0.343437, 0.960938, 0.301758, 0.000000, 0.886465, 0.301758, -0.377168, 1.000000, 0.450000, 0.000000, 0.532500, 0.075000, -0.532500, 0.560234, 0.117773, -0.560234, 0.621250, 0.192187, -0.621250, 0.682266, 0.301758, -0.682266, 0.922500, 0.450000, -0.392500, 0.978516, 0.625195, 0.000000, 0.902681, 0.625195, -0.384067, 0.921875, 0.810938, 0.000000, 0.294375, 0.075000, -0.691875, 0.309707, 0.117773, -0.727910, 0.343437, 0.192187, -0.807187, 0.377168, 0.301758, -0.886465, 0.710000, 0.450000, -0.710000, 0.694746, 0.625195, -0.694746, 0.850430, 0.810938, -0.361836, 0.841797, 1.003711, 0.000000, 0.000000, 0.075000, -0.750000, 0.000000, 0.117773, -0.789063, 0.000000, 0.192187, -0.875000, 0.000000, 0.301758, -0.960938, 0.392500, 0.450000, -0.922500, 0.384067, 0.625195, -0.902681, 0.654531, 0.810938, -0.654531, -0.294375, 0.075000, -0.691875, -0.309707, 0.117773, -0.727910, -0.343437, 0.192187, -0.807187, -0.377168, 0.301758, -0.886465, 0.000000, 0.450000, -1.000000, 0.000000, 0.625195, -0.978516, 0.361836, 0.810938, -0.850430, -0.532500, 0.075000, -0.532500, -0.560234, 0.117773, -0.560234, -0.621250, 0.192187, -0.621250, -0.682266, 0.301758, -0.682266, -0.392500, 0.450000, -0.922500, -0.384067, 0.625195, -0.902681, 0.000000, 0.810938, -0.921875, -0.691875, 0.075000, -0.294375, -0.727910, 0.117773, -0.309707, -0.807187, 0.192187, -0.343437, -0.886465, 0.301758, -0.377168, -0.710000, 0.450000, -0.710000, -0.694746, 0.625195, -0.694746, -0.361836, 0.810938, -0.850430, -0.750000, 0.075000, 0.000000, -0.789063, 0.117773, 0.000000, -0.875000, 0.192187, 0.000000, -0.960938, 0.301758, 0.000000, -0.922500, 0.450000, -0.392500, -0.902681, 0.625195, -0.384067, -0.654531, 0.810938, -0.654531, -0.330405, 1.003711, -0.776558, 0.000000, 1.003711, -0.841797, -1.000000, 0.450000, 0.000000, -0.978516, 0.625195, 0.000000, -0.850430, 0.810938, -0.361836, -0.597676, 1.003711, -0.597676, -0.294375, 1.200000, -0.691875, 0.000000, 1.200000, -0.750000, 0.294375, 1.200000, -0.691875, 0.330405, 1.003711, -0.776558, -0.921875, 0.810938, 0.000000, -0.776558, 1.003711, -0.330405, -0.532500, 1.200000, -0.532500, -0.284706, 1.236914, -0.668452, 0.000000, 1.236914, -0.724609, 0.284409, 1.236914, -0.668452, 0.514473, 1.236914, -0.514473, -0.841797, 1.003711, 0.000000, -0.691875, 1.200000, -0.294375, -0.514736, 1.236914, -0.514473, -0.277736, 1.249219, -0.647191, 0.000000, 1.249219, -0.701563, 0.275363, 1.249219, -0.647191, 0.498109, 1.249219, -0.498109, -0.750000, 1.200000, 0.000000, -0.668551, 1.236914, -0.284409, -0.500219, 1.249219, -0.498109, -0.278926, 1.236914, -0.636741, 0.000000, 1.236914, -0.690234, 0.270917, 1.236914, -0.636741, 0.490066, 1.236914, -0.490066, -0.724609, 1.236914, 0.000000, -0.647982, 1.249219, -0.275363, -0.497186, 1.236914, -0.490066, -0.293734, 1.200000, -0.645750, 0.000000, 1.200000, -0.700000, 0.274750, 1.200000, -0.645750, 0.497000, 1.200000, -0.497000, -0.701563, 1.249219, 0.000000, -0.639411, 1.236914, -0.270917, -0.513875, 1.200000, -0.497000, -0.690234, 1.236914, 0.000000, -0.652078, 1.200000, -0.274750, -0.700000, 1.200000, 0.000000, 0.645750, 1.200000, -0.274750, 0.636741, 1.236914, -0.270917, 0.647191, 1.249219, -0.275363, 0.668452, 1.236914, -0.284409, 0.532500, 1.200000, -0.532500, 0.700000, 1.200000, 0.000000, 0.690234, 1.236914, 0.000000, 0.701563, 1.249219, 0.000000, 0.724609, 1.236914, 0.000000, 0.691875, 1.200000, -0.294375, 0.597676, 1.003711, -0.597676, 0.514473, 1.236914, -0.514473, 0.750000, 1.200000, 0.000000, 0.776558, 1.003711, -0.330405 }; // Indices static const OdInt32 ExTeapotBodyIndices[512 * 4] = { 3, 0, 1, 2, 3, 3, 4, 5, 3, 6, 7, 8, 3, 9, 10, 11, 3, 12, 13, 14, 3, 15, 16, 17, 3, 18, 19, 20, 3, 21, 22, 23, 3, 24, 25, 26, 3, 27, 28, 29, 3, 30, 31, 32, 3, 33, 34, 35, 3, 36, 37, 38, 3, 39, 40, 41, 3, 42, 43, 44, 3, 45, 46, 47, 3, 48, 49, 50, 3, 50, 51, 48, 3, 52, 48, 51, 3, 48, 52, 53, 3, 53, 54, 48, 3, 51, 50, 55, 3, 55, 56, 51, 3, 57, 51, 56, 3, 51, 57, 52, 3, 58, 52, 57, 3, 52, 58, 59, 3, 59, 53, 52, 3, 53, 59, 60, 3, 60, 61, 53, 3, 56, 55, 62, 3, 62, 63, 56, 3, 64, 56, 63, 3, 56, 64, 57, 3, 65, 57, 64, 3, 57, 65, 58, 3, 66, 58, 65, 3, 58, 66, 67, 3, 67, 59, 58, 3, 59, 67, 68, 3, 68, 60, 59, 3, 63, 62, 69, 3, 70, 67, 66, 3, 67, 70, 71, 3, 71, 68, 67, 3, 68, 71, 72, 3, 72, 73, 68, 3, 60, 68, 73, 3, 73, 74, 60, 3, 75, 71, 70, 3, 71, 75, 76, 3, 76, 72, 71, 3, 72, 76, 77, 3, 77, 78, 72, 3, 73, 72, 78, 3, 78, 79, 73, 3, 80, 76, 75, 3, 76, 80, 81, 3, 81, 77, 76, 3, 77, 81, 82, 3, 82, 83, 77, 3, 78, 77, 83, 3, 83, 84, 78, 3, 85, 81, 80, 3, 81, 85, 86, 3, 86, 82, 81, 3, 82, 86, 87, 3, 87, 88, 82, 3, 83, 82, 88, 3, 88, 89, 83, 3, 88, 87, 90, 3, 90, 91, 88, 3, 92, 49, 93, 3, 93, 94, 92, 3, 95, 92, 94, 3, 92, 95, 96, 3, 96, 54, 92, 3, 94, 93, 97, 3, 97, 98, 94, 3, 99, 94, 98, 3, 94, 99, 95, 3, 100, 95, 99, 3, 95, 100, 101, 3, 101, 96, 95, 3, 96, 101, 102, 3, 102, 61, 96, 3, 98, 97, 103, 3, 103, 104, 98, 3, 105, 98, 104, 3, 98, 105, 99, 3, 106, 99, 105, 3, 99, 106, 100, 3, 107, 100, 106, 3, 100, 107, 108, 3, 108, 101, 100, 3, 101, 108, 109, 3, 109, 102, 101, 3, 104, 103, 110, 3, 111, 108, 107, 3, 108, 111, 112, 3, 112, 109, 108, 3, 109, 112, 113, 3, 113, 114, 109, 3, 102, 109, 114, 3, 114, 74, 102, 3, 115, 112, 111, 3, 112, 115, 116, 3, 116, 113, 112, 3, 113, 116, 117, 3, 117, 118, 113, 3, 114, 113, 118, 3, 118, 79, 114, 3, 119, 116, 115, 3, 116, 119, 120, 3, 120, 117, 116, 3, 117, 120, 121, 3, 121, 122, 117, 3, 118, 117, 122, 3, 122, 84, 118, 3, 123, 120, 119, 3, 120, 123, 124, 3, 124, 121, 120, 3, 121, 124, 125, 3, 125, 126, 121, 3, 122, 121, 126, 3, 126, 89, 122, 3, 126, 125, 127, 3, 127, 91, 126, 3, 128, 129, 130, 3, 129, 128, 131, 3, 131, 132, 129, 3, 132, 131, 133, 3, 133, 134, 132, 3, 134, 133, 135, 3, 135, 136, 134, 3, 137, 131, 128, 3, 131, 137, 138, 3, 138, 133, 131, 3, 133, 138, 139, 3, 139, 135, 133, 3, 135, 139, 140, 3, 140, 141, 135, 3, 136, 135, 141, 3, 141, 142, 136, 3, 142, 141, 143, 3, 143, 144, 142, 3, 145, 138, 137, 3, 138, 145, 146, 3, 146, 139, 138, 3, 139, 146, 147, 3, 147, 140, 139, 3, 140, 147, 148, 3, 148, 149, 140, 3, 141, 140, 149, 3, 149, 143, 141, 3, 143, 149, 150, 3, 150, 151, 143, 3, 144, 143, 151, 3, 151, 152, 144, 3, 153, 146, 145, 3, 146, 153, 154, 3, 154, 147, 146, 3, 147, 154, 155, 3, 155, 148, 147, 3, 148, 155, 156, 3, 156, 157, 148, 3, 149, 148, 157, 3, 157, 150, 149, 3, 150, 157, 158, 3, 158, 159, 150, 3, 151, 150, 159, 3, 160, 154, 153, 3, 154, 160, 161, 3, 161, 155, 154, 3, 155, 161, 162, 3, 162, 156, 155, 3, 156, 162, 163, 3, 163, 164, 156, 3, 157, 156, 164, 3, 164, 158, 157, 3, 158, 164, 165, 3, 165, 166, 158, 3, 159, 158, 166, 3, 167, 161, 160, 3, 161, 167, 168, 3, 168, 162, 161, 3, 162, 168, 169, 3, 169, 163, 162, 3, 163, 169, 170, 3, 170, 171, 163, 3, 164, 163, 171, 3, 171, 165, 164, 3, 165, 171, 172, 3, 172, 173, 165, 3, 166, 165, 173, 3, 174, 168, 167, 3, 168, 174, 175, 3, 175, 169, 168, 3, 169, 175, 176, 3, 176, 170, 169, 3, 170, 176, 177, 3, 177, 178, 170, 3, 171, 170, 178, 3, 178, 172, 171, 3, 172, 178, 179, 3, 179, 180, 172, 3, 173, 172, 180, 3, 181, 175, 174, 3, 175, 181, 182, 3, 182, 176, 175, 3, 176, 182, 183, 3, 183, 177, 176, 3, 177, 183, 184, 3, 184, 185, 177, 3, 178, 177, 185, 3, 185, 179, 178, 3, 179, 185, 186, 3, 186, 187, 179, 3, 180, 179, 187, 3, 187, 188, 180, 3, 189, 180, 188, 3, 180, 189, 173, 3, 185, 184, 190, 3, 190, 186, 185, 3, 186, 190, 191, 3, 191, 192, 186, 3, 187, 186, 192, 3, 192, 193, 187, 3, 188, 187, 193, 3, 193, 194, 188, 3, 195, 188, 194, 3, 188, 195, 189, 3, 196, 189, 195, 3, 189, 196, 197, 3, 197, 173, 189, 3, 173, 197, 166, 3, 192, 191, 198, 3, 198, 199, 192, 3, 193, 192, 199, 3, 199, 200, 193, 3, 194, 193, 200, 3, 200, 201, 194, 3, 202, 194, 201, 3, 194, 202, 195, 3, 203, 195, 202, 3, 195, 203, 196, 3, 199, 198, 204, 3, 204, 205, 199, 3, 200, 199, 205, 3, 205, 206, 200, 3, 201, 200, 206, 3, 206, 207, 201, 3, 208, 201, 207, 3, 201, 208, 202, 3, 209, 202, 208, 3, 202, 209, 203, 3, 205, 204, 210, 3, 210, 211, 205, 3, 206, 205, 211, 3, 211, 212, 206, 3, 207, 206, 212, 3, 212, 213, 207, 3, 214, 207, 213, 3, 207, 214, 208, 3, 215, 208, 214, 3, 208, 215, 209, 3, 211, 210, 216, 3, 216, 217, 211, 3, 212, 211, 217, 3, 217, 218, 212, 3, 213, 212, 218, 3, 218, 219, 213, 3, 220, 213, 219, 3, 213, 220, 214, 3, 221, 214, 220, 3, 214, 221, 215, 3, 217, 216, 222, 3, 222, 223, 217, 3, 218, 217, 223, 3, 223, 224, 218, 3, 219, 218, 224, 3, 223, 222, 225, 3, 225, 226, 223, 3, 224, 223, 226, 3, 226, 225, 227, 3, 228, 215, 221, 3, 215, 228, 229, 3, 229, 209, 215, 3, 209, 229, 230, 3, 230, 203, 209, 3, 203, 230, 231, 3, 231, 196, 203, 3, 232, 229, 228, 3, 229, 232, 233, 3, 233, 230, 229, 3, 230, 233, 234, 3, 234, 231, 230, 3, 231, 234, 235, 3, 235, 236, 231, 3, 196, 231, 236, 3, 236, 197, 196, 3, 197, 236, 237, 3, 237, 166, 197, 3, 238, 233, 232, 3, 233, 238, 239, 3, 239, 234, 233, 3, 234, 239, 240, 3, 240, 235, 234, 3, 235, 240, 241, 3, 241, 242, 235, 3, 236, 235, 242, 3, 242, 237, 236, 3, 237, 242, 243, 3, 243, 159, 237, 3, 166, 237, 159, 3, 242, 241, 244, 3, 244, 243, 242, 3, 243, 244, 152, 3, 152, 151, 243, 3, 159, 243, 151, 3, 245, 246, 247, 3, 246, 245, 248, 3, 248, 249, 246, 3, 249, 248, 250, 3, 250, 251, 249, 3, 251, 250, 252, 3, 252, 253, 251, 3, 254, 248, 245, 3, 248, 254, 255, 3, 255, 250, 248, 3, 250, 255, 256, 3, 256, 252, 250, 3, 252, 256, 257, 3, 257, 258, 252, 3, 253, 252, 258, 3, 258, 259, 253, 3, 259, 258, 260, 3, 260, 261, 259, 3, 262, 255, 254, 3, 255, 262, 263, 3, 263, 256, 255, 3, 256, 263, 264, 3, 264, 257, 256, 3, 257, 264, 265, 3, 265, 266, 257, 3, 258, 257, 266, 3, 266, 260, 258, 3, 260, 266, 267, 3, 267, 268, 260, 3, 261, 260, 268, 3, 268, 269, 261, 3, 270, 263, 262, 3, 263, 270, 271, 3, 271, 264, 263, 3, 264, 271, 272, 3, 272, 265, 264, 3, 265, 272, 273, 3, 273, 274, 265, 3, 266, 265, 274, 3, 274, 267, 266, 3, 267, 274, 275, 3, 275, 276, 267, 3, 268, 267, 276, 3, 277, 271, 270, 3, 271, 277, 278, 3, 278, 272, 271, 3, 272, 278, 279, 3, 279, 273, 272, 3, 273, 279, 280, 3, 280, 281, 273, 3, 274, 273, 281, 3, 281, 275, 274, 3, 275, 281, 282, 3, 282, 283, 275, 3, 276, 275, 283, 3, 284, 278, 277, 3, 278, 284, 285, 3, 285, 279, 278, 3, 279, 285, 286, 3, 286, 280, 279, 3, 280, 286, 287, 3, 287, 288, 280, 3, 281, 280, 288, 3, 288, 282, 281, 3, 282, 288, 289, 3, 289, 290, 282, 3, 283, 282, 290, 3, 291, 285, 284, 3, 285, 291, 292, 3, 292, 286, 285, 3, 286, 292, 293, 3, 293, 287, 286, 3, 287, 293, 294, 3, 294, 295, 287, 3, 288, 287, 295, 3, 295, 289, 288, 3, 289, 295, 296, 3, 296, 297, 289, 3, 290, 289, 297, 3, 298, 292, 291, 3, 292, 298, 299, 3, 299, 293, 292, 3, 293, 299, 300, 3, 300, 294, 293, 3, 294, 300, 301, 3, 301, 302, 294, 3, 295, 294, 302, 3, 302, 296, 295, 3, 296, 302, 303, 3, 303, 304, 296, 3, 297, 296, 304, 3, 304, 305, 297, 3, 306, 297, 305, 3, 297, 306, 290, 3, 302, 301, 307, 3, 307, 303, 302, 3, 303, 307, 308, 3, 308, 309, 303, 3, 304, 303, 309, 3, 309, 310, 304, 3, 305, 304, 310, 3, 310, 311, 305, 3, 312, 305, 311, 3, 305, 312, 306, 3, 313, 306, 312, 3, 306, 313, 314, 3, 314, 290, 306, 3, 290, 314, 283, 3, 309, 308, 315, 3, 315, 316, 309, 3, 310, 309, 316, 3, 316, 317, 310, 3, 311, 310, 317, 3, 317, 318, 311, 3, 319, 311, 318, 3, 311, 319, 312, 3, 320, 312, 319, 3, 312, 320, 313, 3, 321, 313, 320, 3, 316, 315, 322, 3, 322, 323, 316, 3, 317, 316, 323, 3, 323, 324, 317, 3, 318, 317, 324, 3, 324, 325, 318, 3, 326, 318, 325, 3, 318, 326, 319, 3, 327, 319, 326, 3, 319, 327, 320, 3, 328, 320, 327, 3, 320, 328, 321, 3, 323, 322, 329, 3, 329, 330, 323, 3, 324, 323, 330, 3, 330, 331, 324, 3, 325, 324, 331, 3, 331, 332, 325, 3, 333, 325, 332, 3, 325, 333, 326, 3, 334, 326, 333, 3, 326, 334, 327, 3, 335, 327, 334, 3, 327, 335, 328, 3, 330, 329, 336, 3, 336, 337, 330, 3, 331, 330, 337, 3, 337, 338, 331, 3, 332, 331, 338, 3, 338, 339, 332, 3, 340, 332, 339, 3, 332, 340, 333, 3, 341, 333, 340, 3, 333, 341, 334, 3, 342, 334, 341, 3, 334, 342, 335, 3, 337, 336, 343, 3, 343, 344, 337, 3, 338, 337, 344, 3, 344, 345, 338, 3, 339, 338, 345, 3, 344, 343, 346, 3, 346, 347, 344, 3, 345, 344, 347, 3, 347, 346, 348, 3, 349, 335, 342, 3, 335, 349, 350, 3, 350, 328, 335, 3, 328, 350, 351, 3, 351, 321, 328, 3, 321, 351, 352, 3, 352, 353, 321, 3, 354, 350, 349, 3, 350, 354, 355, 3, 355, 351, 350, 3, 351, 355, 356, 3, 356, 352, 351, 3, 352, 356, 357, 3, 357, 358, 352, 3, 353, 352, 358, 3, 358, 359, 353, 3, 314, 353, 359, 3, 353, 314, 313, 3, 313, 360, 353, 3, 358, 357, 361, 3, 361, 362, 358, 3, 359, 358, 362, 3, 362, 276, 359, 3, 283, 359, 276, 3, 359, 283, 314, 3, 362, 361, 269, 3, 269, 268, 362, 3, 276, 362, 268 }; // Normals static const double ExTeapotBodyNormals[363 * 3] = { 0.000000, -1.000000, -0.000000, 0.038423, -0.999124, 0.016563, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, 0.028967, -0.999126, 0.030123, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, 0.015076, -0.999117, 0.039224, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, -0.000842, -0.999117, 0.042001, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, -0.016563, -0.999124, 0.038423, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, -0.030123, -0.999126, 0.028967, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, -0.039224, -0.999117, 0.015076, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, -0.042001, -0.999117, -0.000842, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, -0.038423, -0.999124, -0.016563, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, -0.028967, -0.999126, -0.030123, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, -0.015076, -0.999117, -0.039224, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, 0.000842, -0.999117, -0.042001, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, 0.016563, -0.999124, -0.038423, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, 0.030123, -0.999126, -0.028967, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, 0.039224, -0.999117, -0.015076, 0.000000, -1.000000, -0.000000, 0.000000, -1.000000, -0.000000, 0.042001, -0.999117, 0.000842, 0.000000, -1.000000, -0.000000, 0.038423, -0.999124, 0.016563, 0.000000, -1.000000, -0.000000, 0.042001, -0.999117, 0.000842, 0.132609, -0.989583, 0.056043, 0.100275, -0.989643, 0.102719, 0.028967, -0.999126, 0.030123, 0.000000, -1.000000, -0.000000, 0.144219, -0.989544, 0.001769, 0.430357, -0.884825, 0.178540, 0.327021, -0.885364, 0.330436, 0.173941, -0.884904, 0.432075, 0.052771, -0.989582, 0.133947, 0.015076, -0.999117, 0.039224, 0.000000, -1.000000, -0.000000, 0.466360, -0.884592, 0.002442, 0.717727, -0.630270, 0.296021, 0.546647, -0.630850, 0.550641, 0.290730, -0.630256, 0.719898, -0.002834, -0.629277, 0.777176, -0.002442, -0.884592, 0.466360, -0.001769, -0.989544, 0.144219, 0.777176, -0.629277, 0.002834, -0.296021, -0.630270, 0.717727, -0.178540, -0.884825, 0.430357, -0.056043, -0.989583, 0.132609, -0.000842, -0.999117, 0.042001, 0.000000, -1.000000, -0.000000, -0.550641, -0.630850, 0.546647, -0.330436, -0.885364, 0.327021, -0.102719, -0.989643, 0.100275, -0.016563, -0.999124, 0.038423, 0.000000, -1.000000, -0.000000, -0.719898, -0.630256, 0.290730, -0.432075, -0.884904, 0.173941, -0.133947, -0.989582, 0.052771, -0.030123, -0.999126, 0.028967, 0.000000, -1.000000, -0.000000, -0.777176, -0.629277, -0.002834, -0.466360, -0.884592, -0.002442, -0.144219, -0.989544, -0.001769, -0.039224, -0.999117, 0.015076, 0.000000, -1.000000, -0.000000, -0.042001, -0.999117, -0.000842, 0.000000, -1.000000, -0.000000, -0.038423, -0.999124, -0.016563, -0.042001, -0.999117, -0.000842, -0.132609, -0.989583, -0.056043, -0.100275, -0.989643, -0.102719, -0.028967, -0.999126, -0.030123, -0.144219, -0.989544, -0.001769, -0.430357, -0.884825, -0.178540, -0.327021, -0.885364, -0.330436, -0.173941, -0.884904, -0.432075, -0.052771, -0.989582, -0.133947, -0.015076, -0.999117, -0.039224, -0.466360, -0.884592, -0.002442, -0.717727, -0.630270, -0.296021, -0.546647, -0.630850, -0.550641, -0.290730, -0.630256, -0.719898, 0.002834, -0.629277, -0.777176, 0.002442, -0.884592, -0.466360, 0.001769, -0.989544, -0.144219, -0.777176, -0.629277, -0.002834, 0.296021, -0.630270, -0.717727, 0.178540, -0.884825, -0.430357, 0.056043, -0.989583, -0.132609, 0.000842, -0.999117, -0.042001, 0.550641, -0.630850, -0.546647, 0.330436, -0.885364, -0.327021, 0.102719, -0.989643, -0.100275, 0.016563, -0.999124, -0.038423, 0.719898, -0.630256, -0.290730, 0.432075, -0.884904, -0.173941, 0.133947, -0.989582, -0.052771, 0.030123, -0.999126, -0.028967, 0.777176, -0.629277, 0.002834, 0.466360, -0.884592, 0.002442, 0.144219, -0.989544, 0.001769, 0.039224, -0.999117, -0.015076, 0.042001, -0.999117, 0.000842, -0.719898, -0.630256, 0.290730, -0.679500, -0.733659, -0.004828, -0.777176, -0.629277, -0.002834, -0.630137, -0.734493, 0.251887, -0.738621, -0.674098, -0.005536, -0.685269, -0.674864, 0.273797, -0.906835, -0.421465, -0.004100, -0.840707, -0.422185, 0.339075, -0.998647, -0.051997, -0.000484, -0.550641, -0.630850, 0.546647, -0.482802, -0.735046, 0.476035, -0.525184, -0.675601, 0.517442, -0.643630, -0.422882, 0.637897, -0.924585, -0.052158, 0.377388, -0.978092, 0.208155, 0.002725, -0.904304, 0.208606, 0.372448, -0.941624, 0.336635, 0.004625, -0.296021, -0.630270, 0.717727, -0.260867, -0.734536, 0.626422, -0.284064, -0.674966, 0.680976, -0.346706, -0.422165, 0.837598, -0.706482, -0.052206, 0.705803, -0.689592, 0.208974, 0.693392, -0.869697, 0.337356, 0.360304, -0.915429, 0.402438, 0.005851, -0.002834, -0.629277, 0.777176, -0.004828, -0.733659, 0.679500, -0.005536, -0.674098, 0.738621, -0.004100, -0.421465, 0.906835, -0.378291, -0.052043, 0.924222, -0.367383, 0.208618, 0.906371, -0.662301, 0.337864, 0.668735, 0.290730, -0.630256, 0.719898, 0.251887, -0.734493, 0.630137, 0.273797, -0.674864, 0.685269, 0.339075, -0.422185, 0.840707, -0.000484, -0.051997, 0.998647, 0.002725, 0.208155, 0.978092, -0.351725, 0.337320, 0.873215, 0.546647, -0.630850, 0.550641, 0.476035, -0.735046, 0.482802, 0.517442, -0.675601, 0.525184, 0.637897, -0.422882, 0.643630, 0.377388, -0.052158, 0.924585, 0.372448, 0.208606, 0.904304, 0.004625, 0.336635, 0.941624, 0.717727, -0.630270, 0.296021, 0.626422, -0.734536, 0.260867, 0.680976, -0.674966, 0.284064, 0.837598, -0.422165, 0.346706, 0.705803, -0.052206, 0.706482, 0.693392, 0.208974, 0.689592, 0.360304, 0.337356, 0.869697, 0.777176, -0.629277, 0.002834, 0.679500, -0.733659, 0.004828, 0.738621, -0.674098, 0.005536, 0.906835, -0.421465, 0.004100, 0.924222, -0.052043, 0.378291, 0.906371, 0.208618, 0.367383, 0.668735, 0.337864, 0.662301, 0.351450, 0.403277, 0.844897, 0.005851, 0.402438, 0.915429, 0.998647, -0.051997, 0.000484, 0.978092, 0.208155, -0.002725, 0.873215, 0.337320, 0.351725, 0.650935, 0.403824, 0.642814, 0.343713, 0.446390, 0.826195, 0.006127, 0.445500, 0.895261, -0.332366, 0.446280, 0.830883, -0.340612, 0.403214, 0.849354, 0.941624, 0.336635, -0.004625, 0.849354, 0.403214, 0.340612, 0.636786, 0.446962, 0.628274, 0.277308, 0.685259, 0.673440, 0.002243, 0.684558, 0.728955, -0.273137, 0.685198, 0.675204, 0.915429, 0.402438, -0.005851, 0.830883, 0.446280, 0.332366, 0.516083, 0.685982, 0.512920, 0.028087, 0.997242, 0.068699, 0.000681, 0.997288, 0.073588, -0.026891, 0.997226, 0.069413, 0.895261, 0.445500, -0.006127, 0.675204, 0.685198, 0.273137, 0.052500, 0.997290, 0.051540, -0.376868, 0.043316, -0.925253, 0.000538, 0.043140, -0.999069, 0.377870, 0.043483, -0.924837, 0.728955, 0.684558, -0.002243, 0.069413, 0.997226, 0.026891, -0.706062, 0.043366, -0.706821, -0.364647, -0.256327, -0.895170, 0.001220, -0.255752, -0.966742, 0.366927, -0.256336, -0.894235, 0.073588, 0.997288, -0.000681, -0.924837, 0.043483, -0.377870, -0.682545, -0.256729, -0.684268, -0.999069, 0.043140, -0.000538, -0.894235, -0.256336, -0.366927, -0.966742, -0.255752, -0.001220, 0.684268, -0.256729, -0.682545, 0.706821, 0.043366, -0.706062, -0.051540, 0.997290, 0.052500, -0.512920, 0.685982, 0.516083, 0.895170, -0.256327, -0.364647, 0.925253, 0.043316, -0.376868, -0.068699, 0.997242, 0.028087, -0.673440, 0.685259, 0.277308, -0.628274, 0.446962, 0.636786, -0.642814, 0.403824, 0.650935, 0.966697, -0.255740, -0.009653, 0.999169, 0.039728, -0.009059, -0.073204, 0.997317, -0.000152, -0.729084, 0.684420, 0.002551, -0.826195, 0.446390, 0.343713, -0.844897, 0.403277, 0.351450, -0.895267, 0.445487, 0.006145, 0.719898, -0.630256, -0.290730, 0.679500, -0.733659, 0.004828, 0.777176, -0.629277, 0.002834, 0.630137, -0.734493, -0.251887, 0.738621, -0.674098, 0.005536, 0.685269, -0.674864, -0.273797, 0.906835, -0.421465, 0.004100, 0.840707, -0.422185, -0.339075, 0.998647, -0.051997, 0.000484, 0.550641, -0.630850, -0.546647, 0.482802, -0.735046, -0.476035, 0.525184, -0.675601, -0.517442, 0.643630, -0.422882, -0.637897, 0.924585, -0.052158, -0.377388, 0.978092, 0.208155, -0.002725, 0.904304, 0.208606, -0.372448, 0.941624, 0.336635, -0.004625, 0.296021, -0.630270, -0.717727, 0.260867, -0.734536, -0.626422, 0.284064, -0.674966, -0.680976, 0.346706, -0.422165, -0.837598, 0.706482, -0.052206, -0.705803, 0.689592, 0.208974, -0.693392, 0.869697, 0.337356, -0.360304, 0.915429, 0.402438, -0.005851, 0.002834, -0.629277, -0.777176, 0.004828, -0.733659, -0.679500, 0.005536, -0.674098, -0.738621, 0.004100, -0.421465, -0.906835, 0.378291, -0.052043, -0.924222, 0.367383, 0.208618, -0.906371, 0.662301, 0.337864, -0.668735, -0.290730, -0.630256, -0.719898, -0.251887, -0.734493, -0.630137, -0.273797, -0.674864, -0.685269, -0.339075, -0.422185, -0.840707, 0.000484, -0.051997, -0.998647, -0.002725, 0.208155, -0.978092, 0.351725, 0.337320, -0.873215, -0.546647, -0.630850, -0.550641, -0.476035, -0.735046, -0.482802, -0.517442, -0.675601, -0.525184, -0.637897, -0.422882, -0.643630, -0.377388, -0.052158, -0.924585, -0.372448, 0.208606, -0.904304, -0.004625, 0.336635, -0.941624, -0.717727, -0.630270, -0.296021, -0.626422, -0.734536, -0.260867, -0.680976, -0.674966, -0.284064, -0.837598, -0.422165, -0.346706, -0.705803, -0.052206, -0.706482, -0.693392, 0.208974, -0.689592, -0.360304, 0.337356, -0.869697, -0.777176, -0.629277, -0.002834, -0.679500, -0.733659, -0.004828, -0.738621, -0.674098, -0.005536, -0.906835, -0.421465, -0.004100, -0.924222, -0.052043, -0.378291, -0.906371, 0.208618, -0.367383, -0.668735, 0.337864, -0.662301, -0.351450, 0.403277, -0.844897, -0.005851, 0.402438, -0.915429, -0.998647, -0.051997, -0.000484, -0.978092, 0.208155, 0.002725, -0.873215, 0.337320, -0.351725, -0.650935, 0.403824, -0.642814, -0.343653, 0.446112, -0.826370, -0.006127, 0.445500, -0.895261, 0.332366, 0.446280, -0.830883, 0.340612, 0.403214, -0.849354, -0.941624, 0.336635, 0.004625, -0.849354, 0.403214, -0.340612, -0.636916, 0.446472, -0.628491, -0.277839, 0.679586, -0.678947, -0.002240, 0.684580, -0.728934, 0.273137, 0.685198, -0.675204, 0.512920, 0.685982, -0.516083, -0.915429, 0.402438, 0.005851, -0.831010, 0.446020, -0.332400, -0.522353, 0.675688, -0.520186, -0.044855, 0.997319, -0.057814, -0.000627, 0.997392, -0.072172, 0.026891, 0.997226, -0.069413, 0.051540, 0.997290, -0.052500, -0.895267, 0.445487, 0.006145, -0.679889, 0.679941, -0.274648, -0.065495, 0.996808, -0.045663, 0.353760, -0.087981, 0.931189, -0.000646, 0.040364, 0.999185, -0.377870, 0.043483, 0.924837, -0.706821, 0.043366, 0.706062, -0.729084, 0.684420, 0.002551, -0.072569, 0.996992, -0.027228, 0.695812, -0.173404, 0.696977, 0.371495, -0.357310, 0.856926, -0.001001, -0.258014, 0.966141, -0.366927, -0.256336, 0.894235, -0.684268, -0.256729, 0.682545, -0.073204, 0.997317, -0.000152, 0.930079, -0.068165, 0.360980, 0.663802, -0.411075, 0.624808, 0.999169, 0.039728, -0.009059, 0.881702, -0.332968, 0.334266, 0.966697, -0.255740, -0.009653, -0.895170, -0.256327, 0.364647, -0.925253, 0.043316, 0.376868, 0.068699, 0.997242, -0.028087, 0.673440, 0.685259, -0.277308, 0.628274, 0.446962, -0.636786, -0.966742, -0.255752, -0.001220, -0.999069, 0.043140, -0.000538, 0.073588, 0.997288, -0.000681, 0.728955, 0.684558, -0.002243, 0.826195, 0.446390, -0.343713, 0.642814, 0.403824, -0.650935, 0.512920, 0.685982, -0.516083, 0.895261, 0.445500, -0.006127, 0.844897, 0.403277, -0.351450 }; // Texture coords #ifdef EXTEAPOT_ENABLETEXCOORDS static const double ExTeapotBodyTexCoords[363 * 2] = { 0.000000, 0.000000, 0.250000, -0.100000, 0.250000, 0.000000, 0.250000, 0.000000, 0.500000, -0.100000, 0.500000, 0.000000, 0.500000, 0.000000, 0.750000, -0.100000, 0.750000, 0.000000, 0.750000, 0.000000, 1.000000, -0.100000, 1.000000, 0.000000, 1.000000, 0.000000, 1.250000, -0.100000, 1.250000, 0.000000, 1.250000, 0.000000, 1.500000, -0.100000, 1.500000, 0.000000, 1.500000, 0.000000, 1.750000, -0.100000, 1.750000, 0.000000, 1.750000, 0.000000, 2.000000, -0.100000, 2.000000, 0.000000, 0.000000, 0.000000, 0.250000, -0.100000, 0.250000, 0.000000, 0.250000, 0.000000, 0.500000, -0.100000, 0.500000, 0.000000, 0.500000, 0.000000, 0.750000, -0.100000, 0.750000, 0.000000, 0.750000, 0.000000, 1.000000, -0.100000, 1.000000, 0.000000, 1.000000, 0.000000, 1.250000, -0.100000, 1.250000, 0.000000, 1.250000, 0.000000, 1.500000, -0.100000, 1.500000, 0.000000, 1.500000, 0.000000, 1.750000, -0.100000, 1.750000, 0.000000, 1.750000, 0.000000, 2.000000, -0.100000, 2.000000, 0.000000, 0.250000, -0.100000, 0.000000, 0.000000, 0.000000, -0.100000, 0.250000, -0.200000, 0.500000, -0.200000, 0.500000, -0.100000, 0.250000, 0.000000, 0.000000, -0.200000, 0.250000, -0.300000, 0.500000, -0.300000, 0.750000, -0.300000, 0.750000, -0.200000, 0.750000, -0.100000, 0.500000, 0.000000, 0.000000, -0.300000, 0.250000, -0.400000, 0.500000, -0.400000, 0.750000, -0.400000, 1.000000, -0.400000, 1.000000, -0.300000, 1.000000, -0.200000, 0.000000, -0.400000, 1.250000, -0.400000, 1.250000, -0.300000, 1.250000, -0.200000, 1.000000, -0.100000, 0.750000, 0.000000, 1.500000, -0.400000, 1.500000, -0.300000, 1.500000, -0.200000, 1.250000, -0.100000, 1.000000, 0.000000, 1.750000, -0.400000, 1.750000, -0.300000, 1.750000, -0.200000, 1.500000, -0.100000, 1.250000, 0.000000, 2.000000, -0.400000, 2.000000, -0.300000, 2.000000, -0.200000, 1.750000, -0.100000, 1.500000, 0.000000, 2.000000, -0.100000, 1.750000, 0.000000, 0.250000, -0.100000, 0.000000, -0.100000, 0.250000, -0.200000, 0.500000, -0.200000, 0.500000, -0.100000, 0.000000, -0.200000, 0.250000, -0.300000, 0.500000, -0.300000, 0.750000, -0.300000, 0.750000, -0.200000, 0.750000, -0.100000, 0.000000, -0.300000, 0.250000, -0.400000, 0.500000, -0.400000, 0.750000, -0.400000, 1.000000, -0.400000, 1.000000, -0.300000, 1.000000, -0.200000, 0.000000, -0.400000, 1.250000, -0.400000, 1.250000, -0.300000, 1.250000, -0.200000, 1.000000, -0.100000, 1.500000, -0.400000, 1.500000, -0.300000, 1.500000, -0.200000, 1.250000, -0.100000, 1.750000, -0.400000, 1.750000, -0.300000, 1.750000, -0.200000, 1.500000, -0.100000, 2.000000, -0.400000, 2.000000, -0.300000, 2.000000, -0.200000, 1.750000, -0.100000, 2.000000, -0.100000, 1.750000, -0.400000, 2.000000, -0.550000, 2.000000, -0.400000, 1.750000, -0.550000, 2.000000, -0.700000, 1.750000, -0.700000, 2.000000, -0.850000, 1.750000, -0.850000, 2.000000, -1.000000, 1.500000, -0.400000, 1.500000, -0.550000, 1.500000, -0.700000, 1.500000, -0.850000, 1.750000, -1.000000, 2.000000, -1.225000, 1.750000, -1.225000, 2.000000, -1.450000, 1.250000, -0.400000, 1.250000, -0.550000, 1.250000, -0.700000, 1.250000, -0.850000, 1.500000, -1.000000, 1.500000, -1.225000, 1.750000, -1.450000, 2.000000, -1.675000, 1.000000, -0.400000, 1.000000, -0.550000, 1.000000, -0.700000, 1.000000, -0.850000, 1.250000, -1.000000, 1.250000, -1.225000, 1.500000, -1.450000, 0.750000, -0.400000, 0.750000, -0.550000, 0.750000, -0.700000, 0.750000, -0.850000, 1.000000, -1.000000, 1.000000, -1.225000, 1.250000, -1.450000, 0.500000, -0.400000, 0.500000, -0.550000, 0.500000, -0.700000, 0.500000, -0.850000, 0.750000, -1.000000, 0.750000, -1.225000, 1.000000, -1.450000, 0.250000, -0.400000, 0.250000, -0.550000, 0.250000, -0.700000, 0.250000, -0.850000, 0.500000, -1.000000, 0.500000, -1.225000, 0.750000, -1.450000, 0.000000, -0.400000, 0.000000, -0.550000, 0.000000, -0.700000, 0.000000, -0.850000, 0.250000, -1.000000, 0.250000, -1.225000, 0.500000, -1.450000, 0.750000, -1.675000, 1.000000, -1.675000, 0.000000, -1.000000, 0.000000, -1.225000, 0.250000, -1.450000, 0.500000, -1.675000, 0.750000, -1.900000, 1.000000, -1.900000, 1.250000, -1.900000, 1.250000, -1.675000, 0.000000, -1.450000, 0.250000, -1.675000, 0.500000, -1.900000, 0.750000, -1.925000, 1.000000, -1.925000, 1.250000, -1.925000, 0.000000, -1.675000, 0.250000, -1.900000, 0.500000, -1.925000, 0.750000, -1.950000, 1.000000, -1.950000, 1.250000, -1.950000, 0.000000, -1.900000, 0.250000, -1.925000, 0.500000, -1.950000, 0.750000, -1.975000, 1.000000, -1.975000, 1.250000, -1.975000, 0.000000, -1.925000, 0.250000, -1.950000, 0.500000, -1.975000, 0.750000, -2.000000, 1.000000, -2.000000, 1.250000, -2.000000, 0.000000, -1.950000, 0.250000, -1.975000, 0.500000, -2.000000, 0.000000, -1.975000, 0.250000, -2.000000, 0.000000, -2.000000, 1.500000, -2.000000, 1.500000, -1.975000, 1.500000, -1.950000, 1.500000, -1.925000, 1.750000, -2.000000, 1.750000, -1.975000, 1.750000, -1.950000, 1.750000, -1.925000, 1.500000, -1.900000, 1.500000, -1.675000, 2.000000, -2.000000, 2.000000, -1.975000, 2.000000, -1.950000, 2.000000, -1.925000, 1.750000, -1.900000, 1.750000, -1.675000, 2.000000, -1.900000, 1.750000, -0.400000, 2.000000, -0.550000, 2.000000, -0.400000, 1.750000, -0.550000, 2.000000, -0.700000, 1.750000, -0.700000, 2.000000, -0.850000, 1.750000, -0.850000, 2.000000, -1.000000, 1.500000, -0.400000, 1.500000, -0.550000, 1.500000, -0.700000, 1.500000, -0.850000, 1.750000, -1.000000, 2.000000, -1.225000, 1.750000, -1.225000, 2.000000, -1.450000, 1.250000, -0.400000, 1.250000, -0.550000, 1.250000, -0.700000, 1.250000, -0.850000, 1.500000, -1.000000, 1.500000, -1.225000, 1.750000, -1.450000, 2.000000, -1.675000, 1.000000, -0.400000, 1.000000, -0.550000, 1.000000, -0.700000, 1.000000, -0.850000, 1.250000, -1.000000, 1.250000, -1.225000, 1.500000, -1.450000, 0.750000, -0.400000, 0.750000, -0.550000, 0.750000, -0.700000, 0.750000, -0.850000, 1.000000, -1.000000, 1.000000, -1.225000, 1.250000, -1.450000, 0.500000, -0.400000, 0.500000, -0.550000, 0.500000, -0.700000, 0.500000, -0.850000, 0.750000, -1.000000, 0.750000, -1.225000, 1.000000, -1.450000, 0.250000, -0.400000, 0.250000, -0.550000, 0.250000, -0.700000, 0.250000, -0.850000, 0.500000, -1.000000, 0.500000, -1.225000, 0.750000, -1.450000, 0.000000, -0.400000, 0.000000, -0.550000, 0.000000, -0.700000, 0.000000, -0.850000, 0.250000, -1.000000, 0.250000, -1.225000, 0.500000, -1.450000, 0.750000, -1.675000, 1.000000, -1.675000, 0.000000, -1.000000, 0.000000, -1.225000, 0.250000, -1.450000, 0.500000, -1.675000, 0.750000, -1.900000, 1.000000, -1.900000, 1.250000, -1.900000, 1.250000, -1.675000, 0.000000, -1.450000, 0.250000, -1.675000, 0.500000, -1.900000, 0.750000, -1.925000, 1.000000, -1.925000, 1.250000, -1.925000, 1.500000, -1.925000, 0.000000, -1.675000, 0.250000, -1.900000, 0.500000, -1.925000, 0.750000, -1.950000, 1.000000, -1.950000, 1.250000, -1.950000, 1.500000, -1.950000, 0.000000, -1.900000, 0.250000, -1.925000, 0.500000, -1.950000, 0.750000, -1.975000, 1.000000, -1.975000, 1.250000, -1.975000, 1.500000, -1.975000, 0.000000, -1.925000, 0.250000, -1.950000, 0.500000, -1.975000, 0.750000, -2.000000, 1.000000, -2.000000, 1.250000, -2.000000, 1.500000, -2.000000, 0.000000, -1.950000, 0.250000, -1.975000, 0.500000, -2.000000, 0.000000, -1.975000, 0.250000, -2.000000, 0.000000, -2.000000, 1.750000, -2.000000, 1.750000, -1.975000, 1.750000, -1.950000, 1.750000, -1.925000, 1.500000, -1.900000, 2.000000, -2.000000, 2.000000, -1.975000, 2.000000, -1.950000, 2.000000, -1.925000, 1.750000, -1.900000, 1.500000, -1.675000, 1.500000, -1.925000, 2.000000, -1.900000, 1.750000, -1.675000 }; #endif // EXTEAPOT_ENABLETEXCOORDS // TeapotHandle data // Vertices static const double ExTeapotHandleVertices[159 * 3] = { -1.431274, 1.019916, -0.084375, -1.500000, 0.900000, 0.000000, -1.453125, 1.030078, 0.000000, -1.453125, 1.030078, 0.000000, -1.295898, 1.081494, -0.084375, -1.431274, 1.019916, -0.084375, -1.295898, 1.081494, -0.084375, -1.453125, 1.030078, 0.000000, -1.312500, 1.096875, 0.000000, -1.312500, 1.096875, 0.000000, -1.071167, 1.104181, -0.084375, -1.295898, 1.081494, -0.084375, -1.071167, 1.104181, -0.084375, -1.312500, 1.096875, 0.000000, -1.078125, 1.121484, 0.000000, -1.078125, 1.121484, 0.000000, -0.757813, 1.107422, -0.084375, -1.071167, 1.104181, -0.084375, -0.757813, 1.107422, -0.084375, -1.078125, 1.121484, 0.000000, -0.750000, 1.125000, 0.000000, -1.476563, 0.900000, -0.084375, -1.383203, 0.997559, -0.112500, -1.425000, 0.900000, -0.112500, -1.383203, 0.997559, -0.112500, -1.476563, 0.900000, -0.084375, -1.431274, 1.019916, -0.084375, -1.431274, 1.019916, -0.084375, -1.259375, 1.047656, -0.112500, -1.383203, 0.997559, -0.112500, -1.259375, 1.047656, -0.112500, -1.431274, 1.019916, -0.084375, -1.295898, 1.081494, -0.084375, -1.295898, 1.081494, -0.084375, -1.055859, 1.066113, -0.112500, -1.259375, 1.047656, -0.112500, -1.055859, 1.066113, -0.112500, -1.295898, 1.081494, -0.084375, -1.071167, 1.104181, -0.084375, -1.071167, 1.104181, -0.084375, -0.775000, 1.068750, -0.112500, -1.055859, 1.066113, -0.112500, -0.775000, 1.068750, -0.112500, -1.071167, 1.104181, -0.084375, -0.757813, 1.107422, -0.084375, -1.425000, 0.900000, -0.112500, -1.335132, 0.975201, -0.084375, -1.373438, 0.900000, -0.084375, -1.335132, 0.975201, -0.084375, -1.425000, 0.900000, -0.112500, -1.383203, 0.997559, -0.112500, -1.383203, 0.997559, -0.112500, -1.222852, 1.013818, -0.084375, -1.335132, 0.975201, -0.084375, -1.222852, 1.013818, -0.084375, -1.383203, 0.997559, -0.112500, -1.259375, 1.047656, -0.112500, -1.259375, 1.047656, -0.112500, -1.040552, 1.028046, -0.084375, -1.222852, 1.013818, -0.084375, -1.040552, 1.028046, -0.084375, -1.259375, 1.047656, -0.112500, -1.055859, 1.066113, -0.112500, -1.055859, 1.066113, -0.112500, -0.792188, 1.030078, -0.084375, -1.040552, 1.028046, -0.084375, -0.792188, 1.030078, -0.084375, -1.055859, 1.066113, -0.112500, -0.775000, 1.068750, -0.112500, -1.373438, 0.900000, -0.084375, -1.313281, 0.965039, 0.000000, -1.350000, 0.900000, 0.000000, -1.313281, 0.965039, 0.000000, -1.373438, 0.900000, -0.084375, -1.335132, 0.975201, -0.084375, -1.335132, 0.975201, -0.084375, -1.206250, 0.998438, 0.000000, -1.313281, 0.965039, 0.000000, -1.206250, 0.998438, 0.000000, -1.335132, 0.975201, -0.084375, -1.222852, 1.013818, -0.084375, -1.222852, 1.013818, -0.084375, -1.033594, 1.010742, 0.000000, -1.206250, 0.998438, 0.000000, -1.033594, 1.010742, 0.000000, -1.222852, 1.013818, -0.084375, -1.040552, 1.028046, -0.084375, -1.040552, 1.028046, -0.084375, -0.800000, 1.012500, 0.000000, -1.033594, 1.010742, 0.000000, -0.800000, 1.012500, 0.000000, -1.040552, 1.028046, -0.084375, -0.792188, 1.030078, -0.084375, -0.992188, 0.426562, -0.084375, -1.160156, 0.551953, 0.000000, -1.000000, 0.450000, 0.000000, -1.165466, 0.533414, -0.084375, -1.268750, 0.675000, 0.000000, -1.283887, 0.659985, -0.084375, -1.330469, 0.798047, 0.000000, -1.351770, 0.788205, -0.084375, -1.350000, 0.900000, 0.000000, -1.373438, 0.900000, -0.084375, -0.975000, 0.375000, -0.112500, -1.177148, 0.492627, -0.112500, -1.317188, 0.626953, -0.112500, -1.398633, 0.766553, -0.112500, -1.425000, 0.900000, -0.112500, -1.445496, 0.744901, -0.084375, -1.476563, 0.900000, -0.084375, -0.957812, 0.323438, -0.084375, -1.188831, 0.451840, -0.084375, -1.350488, 0.593921, -0.084375, -1.365625, 0.578906, 0.000000, -1.466797, 0.735059, 0.000000, -1.500000, 0.900000, 0.000000, -1.431274, 1.019916, -0.084375, -0.950000, 0.300000, 0.000000, -1.194141, 0.433301, 0.000000, -1.188831, 0.451840, 0.084375, -1.350488, 0.593921, 0.084375, -1.445496, 0.744901, 0.084375, -1.476563, 0.900000, 0.084375, -1.453125, 1.030078, 0.000000, -0.957812, 0.323438, 0.084375, -0.975000, 0.375000, 0.112500, -1.177148, 0.492627, 0.112500, -1.317188, 0.626953, 0.112500, -1.398633, 0.766553, 0.112500, -1.425000, 0.900000, 0.112500, -1.431274, 1.019916, 0.084375, -1.312500, 1.096875, 0.000000, -0.992188, 0.426562, 0.084375, -1.165466, 0.533414, 0.084375, -1.283887, 0.659985, 0.084375, -1.351770, 0.788205, 0.084375, -1.373438, 0.900000, 0.084375, -1.383203, 0.997559, 0.112500, -1.295898, 1.081494, 0.084375, -1.078125, 1.121484, 0.000000, -1.000000, 0.450000, 0.000000, -1.160156, 0.551953, 0.000000, -1.268750, 0.675000, 0.000000, -1.330469, 0.798047, 0.000000, -1.350000, 0.900000, 0.000000, -1.335132, 0.975201, 0.084375, -1.259375, 1.047656, 0.112500, -1.071167, 1.104181, 0.084375, -0.750000, 1.125000, 0.000000, -0.757813, 1.107422, 0.084375, -1.055859, 1.066113, 0.112500, -0.775000, 1.068750, 0.112500, -1.313281, 0.965039, 0.000000, -1.222852, 1.013818, 0.084375, -1.206250, 0.998438, 0.000000, -1.040552, 1.028046, 0.084375, -0.792188, 1.030078, 0.084375, -1.033594, 1.010742, 0.000000, -0.800000, 1.012500, 0.000000 }; // Indices static const OdInt32 ExTeapotHandleIndices[128 * 4] = { 3, 0, 1, 2, 3, 3, 4, 5, 3, 6, 7, 8, 3, 9, 10, 11, 3, 12, 13, 14, 3, 15, 16, 17, 3, 18, 19, 20, 3, 21, 22, 23, 3, 24, 25, 26, 3, 27, 28, 29, 3, 30, 31, 32, 3, 33, 34, 35, 3, 36, 37, 38, 3, 39, 40, 41, 3, 42, 43, 44, 3, 45, 46, 47, 3, 48, 49, 50, 3, 51, 52, 53, 3, 54, 55, 56, 3, 57, 58, 59, 3, 60, 61, 62, 3, 63, 64, 65, 3, 66, 67, 68, 3, 69, 70, 71, 3, 72, 73, 74, 3, 75, 76, 77, 3, 78, 79, 80, 3, 81, 82, 83, 3, 84, 85, 86, 3, 87, 88, 89, 3, 90, 91, 92, 3, 93, 94, 95, 3, 94, 93, 96, 3, 96, 97, 94, 3, 97, 96, 98, 3, 98, 99, 97, 3, 99, 98, 100, 3, 100, 101, 99, 3, 101, 100, 102, 3, 103, 96, 93, 3, 96, 103, 104, 3, 104, 98, 96, 3, 98, 104, 105, 3, 105, 100, 98, 3, 100, 105, 106, 3, 106, 102, 100, 3, 102, 106, 107, 3, 108, 107, 106, 3, 107, 108, 109, 3, 110, 104, 103, 3, 104, 110, 111, 3, 111, 105, 104, 3, 105, 111, 112, 3, 112, 106, 105, 3, 106, 112, 108, 3, 113, 108, 112, 3, 108, 113, 114, 3, 114, 109, 108, 3, 109, 114, 115, 3, 115, 116, 109, 3, 117, 111, 110, 3, 111, 117, 118, 3, 118, 112, 111, 3, 112, 118, 113, 3, 119, 113, 118, 3, 113, 119, 120, 3, 120, 114, 113, 3, 114, 120, 121, 3, 121, 115, 114, 3, 115, 121, 122, 3, 122, 123, 115, 3, 124, 118, 117, 3, 118, 124, 119, 3, 125, 119, 124, 3, 119, 125, 126, 3, 126, 120, 119, 3, 120, 126, 127, 3, 127, 121, 120, 3, 121, 127, 128, 3, 128, 122, 121, 3, 122, 128, 129, 3, 129, 130, 122, 3, 123, 122, 130, 3, 130, 131, 123, 3, 132, 126, 125, 3, 126, 132, 133, 3, 133, 127, 126, 3, 127, 133, 134, 3, 134, 128, 127, 3, 128, 134, 135, 3, 135, 129, 128, 3, 129, 135, 136, 3, 136, 137, 129, 3, 130, 129, 137, 3, 137, 138, 130, 3, 131, 130, 138, 3, 138, 139, 131, 3, 140, 133, 132, 3, 133, 140, 141, 3, 141, 134, 133, 3, 134, 141, 142, 3, 142, 135, 134, 3, 135, 142, 143, 3, 143, 136, 135, 3, 136, 143, 144, 3, 144, 145, 136, 3, 137, 136, 145, 3, 145, 146, 137, 3, 138, 137, 146, 3, 146, 147, 138, 3, 139, 138, 147, 3, 147, 148, 139, 3, 148, 147, 149, 3, 150, 149, 147, 3, 149, 150, 151, 3, 145, 144, 152, 3, 152, 153, 145, 3, 146, 145, 153, 3, 153, 150, 146, 3, 147, 146, 150, 3, 153, 152, 154, 3, 154, 155, 153, 3, 150, 153, 155, 3, 155, 151, 150, 3, 151, 155, 156, 3, 157, 156, 155, 3, 156, 157, 158, 3, 155, 154, 157 }; // Normals static const double ExTeapotHandleNormals[159 * 3] = { -0.626659, 0.606851, -0.488907, -0.999001, 0.044619, -0.002568, -0.734172, 0.678934, -0.006396, -0.734172, 0.678934, -0.006396, -0.210750, 0.873130, -0.439578, -0.626659, 0.606851, -0.488907, -0.210750, 0.873130, -0.439578, -0.734172, 0.678934, -0.006396, -0.247915, 0.968778, -0.002907, -0.247915, 0.968778, -0.002907, -0.045501, 0.902071, -0.429183, -0.210750, 0.873130, -0.439578, -0.045501, 0.902071, -0.429183, -0.247915, 0.968778, -0.002907, -0.051279, 0.998684, 0.000004, -0.051279, 0.998684, 0.000004, -0.009743, 0.919328, -0.393370, -0.045501, 0.902071, -0.429183, -0.009743, 0.919328, -0.393370, -0.051279, 0.998684, 0.000004, -0.010565, 0.999936, -0.004023, -0.858453, 0.038722, -0.511428, -0.082373, 0.138056, -0.986993, -0.116068, 0.011951, -0.993169, -0.082373, 0.138056, -0.986993, -0.858453, 0.038722, -0.511428, -0.626659, 0.606851, -0.488907, -0.626659, 0.606851, -0.488907, 0.000902, 0.121357, -0.992608, -0.082373, 0.138056, -0.986993, 0.000902, 0.121357, -0.992608, -0.626659, 0.606851, -0.488907, -0.210750, 0.873130, -0.439578, -0.210750, 0.873130, -0.439578, 0.000846, 0.063991, -0.997950, 0.000902, 0.121357, -0.992608, 0.000846, 0.063991, -0.997950, -0.210750, 0.873130, -0.439578, -0.045501, 0.902071, -0.429183, -0.045501, 0.902071, -0.429183, -0.002232, 0.194831, -0.980834, 0.000846, 0.063991, -0.997950, -0.002232, 0.194831, -0.980834, -0.045501, 0.902071, -0.429183, -0.009743, 0.919328, -0.393370, -0.116068, 0.011951, -0.993169, 0.498677, -0.647215, -0.576571, 0.790709, -0.064356, -0.608800, 0.498677, -0.647215, -0.576571, -0.116068, 0.011951, -0.993169, -0.082373, 0.138056, -0.986993, -0.082373, 0.138056, -0.986993, 0.156413, -0.859855, -0.485988, 0.498677, -0.647215, -0.576571, 0.156413, -0.859855, -0.485988, -0.082373, 0.138056, -0.986993, 0.000902, 0.121357, -0.992608, 0.000902, 0.121357, -0.992608, 0.034693, -0.885127, -0.464054, 0.156413, -0.859855, -0.485988, 0.034693, -0.885127, -0.464054, 0.000902, 0.121357, -0.992608, 0.000846, 0.063991, -0.997950, 0.000846, 0.063991, -0.997950, 0.007370, -0.862537, -0.505941, 0.034693, -0.885127, -0.464054, 0.007370, -0.862537, -0.505941, 0.000846, 0.063991, -0.997950, -0.002232, 0.194831, -0.980834, 0.790709, -0.064356, -0.608800, 0.554299, -0.832264, 0.009487, 0.994301, -0.106502, 0.004831, 0.554299, -0.832264, 0.009487, 0.790709, -0.064356, -0.608800, 0.498677, -0.647215, -0.576571, 0.498677, -0.647215, -0.576571, 0.155479, -0.987826, 0.005168, 0.554299, -0.832264, 0.009487, 0.155479, -0.987826, 0.005168, 0.498677, -0.647215, -0.576571, 0.156413, -0.859855, -0.485988, 0.156413, -0.859855, -0.485988, 0.034265, -0.999410, 0.002213, 0.155479, -0.987826, 0.005168, 0.034265, -0.999410, 0.002213, 0.156413, -0.859855, -0.485988, 0.034693, -0.885127, -0.464054, 0.034693, -0.885127, -0.464054, 0.007796, -0.999958, -0.004858, 0.034265, -0.999410, 0.002213, 0.007796, -0.999958, -0.004858, 0.034693, -0.885127, -0.464054, 0.007370, -0.862537, -0.505941, 0.457200, 0.731205, -0.506269, 0.641597, 0.767019, 0.005833, 0.532210, 0.846550, 0.010306, 0.550987, 0.687033, -0.473709, 0.819040, 0.573692, 0.007156, 0.678318, 0.501542, -0.536973, 0.940065, 0.340967, 0.004491, 0.761591, 0.292081, -0.578504, 0.994301, -0.106502, 0.004831, 0.790709, -0.064356, -0.608800, -0.181006, -0.317794, -0.930722, -0.040773, -0.042798, -0.998251, -0.047534, -0.045581, -0.997829, -0.067901, -0.028090, -0.997297, -0.116068, 0.011951, -0.993169, -0.786864, -0.331734, -0.520382, -0.858453, 0.038722, -0.511428, -0.461411, -0.826400, -0.322742, -0.504393, -0.737391, -0.449268, -0.650444, -0.577318, -0.493586, -0.744807, -0.667258, -0.005389, -0.922677, -0.385570, -0.001807, -0.999001, 0.044619, -0.002568, -0.626659, 0.606851, -0.488907, -0.481722, -0.876322, 0.001951, -0.557163, -0.830390, -0.004747, -0.508563, -0.739128, 0.441649, -0.658289, -0.572101, 0.489240, -0.792542, -0.319726, 0.519280, -0.860032, 0.048825, 0.507899, -0.734172, 0.678934, -0.006396, -0.454022, -0.827342, 0.330710, -0.173269, -0.317004, 0.932463, -0.047036, -0.058267, 0.997192, -0.050462, -0.048304, 0.997557, -0.071663, -0.027366, 0.997053, -0.121940, 0.015266, 0.992420, -0.618725, 0.623852, 0.477481, -0.247915, 0.968778, -0.002907, 0.438986, 0.726589, 0.528544, 0.550730, 0.684269, 0.477987, 0.683859, 0.492708, 0.538122, 0.765076, 0.276669, 0.581475, 0.786638, -0.077022, 0.612592, -0.090624, 0.150578, 0.984436, -0.201901, 0.880111, 0.429698, -0.051279, 0.998684, 0.000004, 0.532210, 0.846550, 0.010306, 0.641597, 0.767019, 0.005833, 0.819040, 0.573692, 0.007156, 0.940065, 0.340967, 0.004491, 0.994301, -0.106502, 0.004831, 0.483651, -0.656558, 0.578804, -0.006691, 0.141331, 0.989940, -0.042086, 0.903258, 0.427028, -0.010565, 0.999936, -0.004023, -0.009404, 0.922549, 0.385765, -0.000158, 0.076427, 0.997075, -0.002101, 0.195821, 0.980637, 0.554299, -0.832264, 0.009487, 0.147358, -0.858914, 0.490461, 0.155479, -0.987826, 0.005168, 0.030940, -0.882808, 0.468714, 0.006811, -0.868637, 0.495402, 0.034265, -0.999410, 0.002213, 0.007796, -0.999958, -0.004858 }; // Texture coords #ifdef EXTEAPOT_ENABLETEXCOORDS static const double ExTeapotHandleTexCoords[159 * 2] = { 0.625000, -0.625000, 0.500000, -0.500000, 0.500000, -0.625000, 0.500000, -0.625000, 0.625000, -0.750000, 0.625000, -0.625000, 0.625000, -0.750000, 0.500000, -0.625000, 0.500000, -0.750000, 0.500000, -0.750000, 0.625000, -0.875000, 0.625000, -0.750000, 0.625000, -0.875000, 0.500000, -0.750000, 0.500000, -0.875000, 0.500000, -0.875000, 0.625000, -1.000000, 0.625000, -0.875000, 0.625000, -1.000000, 0.500000, -0.875000, 0.500000, -1.000000, 0.625000, -0.500000, 0.750000, -0.625000, 0.750000, -0.500000, 0.750000, -0.625000, 0.625000, -0.500000, 0.625000, -0.625000, 0.625000, -0.625000, 0.750000, -0.750000, 0.750000, -0.625000, 0.750000, -0.750000, 0.625000, -0.625000, 0.625000, -0.750000, 0.625000, -0.750000, 0.750000, -0.875000, 0.750000, -0.750000, 0.750000, -0.875000, 0.625000, -0.750000, 0.625000, -0.875000, 0.625000, -0.875000, 0.750000, -1.000000, 0.750000, -0.875000, 0.750000, -1.000000, 0.625000, -0.875000, 0.625000, -1.000000, 0.750000, -0.500000, 0.875000, -0.625000, 0.875000, -0.500000, 0.875000, -0.625000, 0.750000, -0.500000, 0.750000, -0.625000, 0.750000, -0.625000, 0.875000, -0.750000, 0.875000, -0.625000, 0.875000, -0.750000, 0.750000, -0.625000, 0.750000, -0.750000, 0.750000, -0.750000, 0.875000, -0.875000, 0.875000, -0.750000, 0.875000, -0.875000, 0.750000, -0.750000, 0.750000, -0.875000, 0.750000, -0.875000, 0.875000, -1.000000, 0.875000, -0.875000, 0.875000, -1.000000, 0.750000, -0.875000, 0.750000, -1.000000, 0.875000, -0.500000, 1.000000, -0.625000, 1.000000, -0.500000, 1.000000, -0.625000, 0.875000, -0.500000, 0.875000, -0.625000, 0.875000, -0.625000, 1.000000, -0.750000, 1.000000, -0.625000, 1.000000, -0.750000, 0.875000, -0.625000, 0.875000, -0.750000, 0.875000, -0.750000, 1.000000, -0.875000, 1.000000, -0.750000, 1.000000, -0.875000, 0.875000, -0.750000, 0.875000, -0.875000, 0.875000, -0.875000, 1.000000, -1.000000, 1.000000, -0.875000, 1.000000, -1.000000, 0.875000, -0.875000, 0.875000, -1.000000, 0.875000, 0.000000, 1.000000, -0.125000, 1.000000, 0.000000, 0.875000, -0.125000, 1.000000, -0.250000, 0.875000, -0.250000, 1.000000, -0.375000, 0.875000, -0.375000, 1.000000, -0.500000, 0.875000, -0.500000, 0.750000, 0.000000, 0.750000, -0.125000, 0.750000, -0.250000, 0.750000, -0.375000, 0.750000, -0.500000, 0.625000, -0.375000, 0.625000, -0.500000, 0.625000, 0.000000, 0.625000, -0.125000, 0.625000, -0.250000, 0.500000, -0.250000, 0.500000, -0.375000, 0.500000, -0.500000, 0.625000, -0.625000, 0.500000, 0.000000, 0.500000, -0.125000, 0.375000, -0.125000, 0.375000, -0.250000, 0.375000, -0.375000, 0.375000, -0.500000, 0.500000, -0.625000, 0.375000, 0.000000, 0.250000, 0.000000, 0.250000, -0.125000, 0.250000, -0.250000, 0.250000, -0.375000, 0.250000, -0.500000, 0.375000, -0.625000, 0.500000, -0.750000, 0.125000, 0.000000, 0.125000, -0.125000, 0.125000, -0.250000, 0.125000, -0.375000, 0.125000, -0.500000, 0.250000, -0.625000, 0.375000, -0.750000, 0.500000, -0.875000, 0.000000, 0.000000, 0.000000, -0.125000, 0.000000, -0.250000, 0.000000, -0.375000, 0.000000, -0.500000, 0.125000, -0.625000, 0.250000, -0.750000, 0.375000, -0.875000, 0.500000, -1.000000, 0.375000, -1.000000, 0.250000, -0.875000, 0.250000, -1.000000, 0.000000, -0.625000, 0.125000, -0.750000, 0.000000, -0.750000, 0.125000, -0.875000, 0.125000, -1.000000, 0.000000, -0.875000, 0.000000, -1.000000 }; #endif // EXTEAPOT_ENABLETEXCOORDS // TeapotSpout data // Vertices static const double ExTeapotSpoutVertices[149 * 3] = { 1.207031, 0.461719, 0.000000, 0.850000, 0.364453, -0.185625, 1.188721, 0.509509, -0.167607, 0.850000, 0.364453, -0.185625, 1.207031, 0.461719, 0.000000, 0.850000, 0.300000, 0.000000, 1.603125, 1.200000, -0.070313, 1.342188, 1.028320, -0.117773, 1.500000, 1.200000, -0.093750, 1.342188, 1.028320, -0.117773, 1.603125, 1.200000, -0.070313, 1.405029, 1.006165, -0.088330, 1.405029, 1.006165, -0.088330, 1.268750, 0.810938, -0.170625, 1.342188, 1.028320, -0.117773, 1.268750, 0.810938, -0.170625, 1.405029, 1.006165, -0.088330, 1.320313, 0.749707, -0.127969, 1.320313, 0.749707, -0.127969, 1.148438, 0.614648, -0.223477, 1.268750, 0.810938, -0.170625, 1.148438, 0.614648, -0.223477, 1.320313, 0.749707, -0.127969, 1.188721, 0.509509, -0.167607, 1.188721, 0.509509, -0.167607, 0.850000, 0.506250, -0.247500, 1.148438, 0.614648, -0.223477, 0.850000, 0.506250, -0.247500, 1.188721, 0.509509, -0.167607, 0.850000, 0.364453, -0.185625, 1.500000, 1.200000, -0.093750, 1.279346, 1.050476, -0.088330, 1.396875, 1.200000, -0.070313, 1.279346, 1.050476, -0.088330, 1.500000, 1.200000, -0.093750, 1.342188, 1.028320, -0.117773, 1.342188, 1.028320, -0.117773, 1.217188, 0.872168, -0.127969, 1.279346, 1.050476, -0.088330, 1.217188, 0.872168, -0.127969, 1.342188, 1.028320, -0.117773, 1.268750, 0.810938, -0.170625, 1.268750, 0.810938, -0.170625, 1.108154, 0.719788, -0.167607, 1.217188, 0.872168, -0.127969, 1.108154, 0.719788, -0.167607, 1.268750, 0.810938, -0.170625, 1.148438, 0.614648, -0.223477, 1.148438, 0.614648, -0.223477, 0.850000, 0.648047, -0.185625, 1.108154, 0.719788, -0.167607, 0.850000, 0.648047, -0.185625, 1.148438, 0.614648, -0.223477, 0.850000, 0.506250, -0.247500, 1.396875, 1.200000, -0.070313, 1.250781, 1.060547, 0.000000, 1.350000, 1.200000, 0.000000, 1.250781, 1.060547, 0.000000, 1.396875, 1.200000, -0.070313, 1.279346, 1.050476, -0.088330, 1.279346, 1.050476, -0.088330, 1.193750, 0.900000, 0.000000, 1.250781, 1.060547, 0.000000, 1.193750, 0.900000, 0.000000, 1.279346, 1.050476, -0.088330, 1.217188, 0.872168, -0.127969, 1.217188, 0.872168, -0.127969, 1.089844, 0.767578, 0.000000, 1.193750, 0.900000, 0.000000, 1.089844, 0.767578, 0.000000, 1.217188, 0.872168, -0.127969, 1.108154, 0.719788, -0.167607, 1.108154, 0.719788, -0.167607, 0.850000, 0.712500, 0.000000, 1.089844, 0.767578, 0.000000, 0.850000, 0.712500, 0.000000, 1.108154, 0.719788, -0.167607, 0.850000, 0.648047, -0.185625, 1.568750, 1.200000, 0.042188, 1.676367, 1.230322, 0.000000, 1.600000, 1.200000, 0.000000, 1.636359, 1.228880, 0.046582, 1.714063, 1.238672, 0.000000, 1.666943, 1.237024, 0.056250, 1.707227, 1.227686, 0.000000, 1.657025, 1.226656, 0.065918, 1.650000, 1.200000, 0.000000, 1.500000, 1.200000, 0.056250, 1.548340, 1.225708, 0.062109, 1.563281, 1.233398, 0.075000, 1.546582, 1.224390, 0.087891, 1.603125, 1.200000, 0.070313, 1.433594, 0.996094, 0.000000, 1.405029, 1.006165, 0.088330, 1.343750, 0.721875, 0.000000, 1.431250, 1.200000, 0.042188, 1.460321, 1.222536, 0.046582, 1.459619, 1.229773, 0.056250, 1.436139, 1.222124, 0.065918, 1.500000, 1.200000, 0.093750, 1.342188, 1.028320, 0.117773, 1.320313, 0.749707, 0.127969, 1.207031, 0.461719, 0.000000, 1.400000, 1.200000, 0.000000, 1.420313, 1.221094, 0.000000, 1.412500, 1.228125, 0.000000, 1.385937, 1.221094, 0.000000, 1.396875, 1.200000, 0.070313, 1.279346, 1.050476, 0.088330, 1.268750, 0.810938, 0.170625, 1.431250, 1.200000, -0.042188, 1.460321, 1.222536, -0.046582, 1.459619, 1.229773, -0.056250, 1.436139, 1.222124, -0.065918, 1.350000, 1.200000, 0.000000, 1.250781, 1.060547, 0.000000, 1.217188, 0.872168, 0.127969, 1.500000, 1.200000, -0.056250, 1.548340, 1.225708, -0.062109, 1.563281, 1.233398, -0.075000, 1.546582, 1.224390, -0.087891, 1.396875, 1.200000, -0.070313, 1.568750, 1.200000, -0.042188, 1.636359, 1.228880, -0.046582, 1.666943, 1.237024, -0.056250, 1.657025, 1.226656, -0.065918, 1.500000, 1.200000, -0.093750, 1.600000, 1.200000, 0.000000, 1.676367, 1.230322, 0.000000, 1.714063, 1.238672, 0.000000, 1.707227, 1.227686, 0.000000, 1.603125, 1.200000, -0.070313, 1.650000, 1.200000, 0.000000, 1.405029, 1.006165, -0.088330, 1.433594, 0.996094, 0.000000, 1.320313, 0.749707, -0.127969, 1.343750, 0.721875, 0.000000, 1.188721, 0.509509, -0.167607, 1.207031, 0.461719, 0.000000, 1.193750, 0.900000, 0.000000, 1.108154, 0.719788, 0.167607, 1.148438, 0.614648, 0.223477, 1.188721, 0.509509, 0.167607, 0.850000, 0.300000, 0.000000, 1.089844, 0.767578, 0.000000, 0.850000, 0.648047, 0.185625, 0.850000, 0.506250, 0.247500, 0.850000, 0.364453, 0.185625, 0.850000, 0.712500, 0.000000 }; // Indices static const OdInt32 ExTeapotSpoutIndices[128 * 4] = { 3, 0, 1, 2, 3, 3, 4, 5, 3, 6, 7, 8, 3, 9, 10, 11, 3, 12, 13, 14, 3, 15, 16, 17, 3, 18, 19, 20, 3, 21, 22, 23, 3, 24, 25, 26, 3, 27, 28, 29, 3, 30, 31, 32, 3, 33, 34, 35, 3, 36, 37, 38, 3, 39, 40, 41, 3, 42, 43, 44, 3, 45, 46, 47, 3, 48, 49, 50, 3, 51, 52, 53, 3, 54, 55, 56, 3, 57, 58, 59, 3, 60, 61, 62, 3, 63, 64, 65, 3, 66, 67, 68, 3, 69, 70, 71, 3, 72, 73, 74, 3, 75, 76, 77, 3, 78, 79, 80, 3, 79, 78, 81, 3, 81, 82, 79, 3, 82, 81, 83, 3, 83, 84, 82, 3, 84, 83, 85, 3, 85, 86, 84, 3, 87, 81, 78, 3, 81, 87, 88, 3, 88, 83, 81, 3, 83, 88, 89, 3, 89, 85, 83, 3, 85, 89, 90, 3, 90, 91, 85, 3, 86, 85, 91, 3, 91, 92, 86, 3, 92, 91, 93, 3, 93, 94, 92, 3, 95, 88, 87, 3, 88, 95, 96, 3, 96, 89, 88, 3, 89, 96, 97, 3, 97, 90, 89, 3, 90, 97, 98, 3, 98, 99, 90, 3, 91, 90, 99, 3, 99, 93, 91, 3, 93, 99, 100, 3, 100, 101, 93, 3, 94, 93, 101, 3, 101, 102, 94, 3, 103, 96, 95, 3, 96, 103, 104, 3, 104, 97, 96, 3, 97, 104, 105, 3, 105, 98, 97, 3, 98, 105, 106, 3, 106, 107, 98, 3, 99, 98, 107, 3, 107, 100, 99, 3, 100, 107, 108, 3, 108, 109, 100, 3, 101, 100, 109, 3, 110, 104, 103, 3, 104, 110, 111, 3, 111, 105, 104, 3, 105, 111, 112, 3, 112, 106, 105, 3, 106, 112, 113, 3, 113, 114, 106, 3, 107, 106, 114, 3, 114, 108, 107, 3, 108, 114, 115, 3, 115, 116, 108, 3, 109, 108, 116, 3, 117, 111, 110, 3, 111, 117, 118, 3, 118, 112, 111, 3, 112, 118, 119, 3, 119, 113, 112, 3, 113, 119, 120, 3, 120, 121, 113, 3, 114, 113, 121, 3, 122, 118, 117, 3, 118, 122, 123, 3, 123, 119, 118, 3, 119, 123, 124, 3, 124, 120, 119, 3, 120, 124, 125, 3, 125, 126, 120, 3, 121, 120, 126, 3, 127, 123, 122, 3, 123, 127, 128, 3, 128, 124, 123, 3, 124, 128, 129, 3, 129, 125, 124, 3, 125, 129, 130, 3, 130, 131, 125, 3, 126, 125, 131, 3, 131, 130, 132, 3, 132, 133, 131, 3, 133, 132, 134, 3, 134, 135, 133, 3, 135, 134, 136, 3, 136, 137, 135, 3, 137, 136, 138, 3, 116, 115, 139, 3, 139, 140, 116, 3, 141, 116, 140, 3, 116, 141, 109, 3, 142, 109, 141, 3, 109, 142, 101, 3, 102, 101, 142, 3, 142, 143, 102, 3, 140, 139, 144, 3, 144, 145, 140, 3, 146, 140, 145, 3, 140, 146, 141, 3, 147, 141, 146, 3, 141, 147, 142, 3, 143, 142, 147, 3, 145, 144, 148 }; // Normals static const double ExTeapotSpoutNormals[149 * 3] = { 0.626211, -0.779643, -0.004147, 0.356034, -0.756438, -0.548673, 0.557512, -0.632921, -0.537207, 0.356034, -0.756438, -0.548673, 0.626211, -0.779643, -0.004147, 0.410930, -0.911586, -0.012123, 0.548239, -0.536344, -0.641692, 0.026866, 0.175416, -0.984128, 0.076142, 0.091738, -0.992868, 0.026866, 0.175416, -0.984128, 0.548239, -0.536344, -0.641692, 0.686239, -0.341396, -0.642281, 0.686239, -0.341396, -0.642281, 0.232530, 0.131167, -0.963704, 0.026866, 0.175416, -0.984128, 0.232530, 0.131167, -0.963704, 0.686239, -0.341396, -0.642281, 0.822048, -0.288177, -0.491112, 0.822048, -0.288177, -0.491112, 0.213926, -0.012188, -0.976774, 0.232530, 0.131167, -0.963704, 0.213926, -0.012188, -0.976774, 0.822048, -0.288177, -0.491112, 0.557512, -0.632921, -0.537207, 0.557512, -0.632921, -0.537207, 0.117970, -0.104411, -0.987513, 0.213926, -0.012188, -0.976774, 0.117970, -0.104411, -0.987513, 0.557512, -0.632921, -0.537207, 0.356034, -0.756438, -0.548673, 0.076142, 0.091738, -0.992868, -0.666299, 0.452648, -0.592584, -0.430840, 0.471468, -0.769477, -0.666299, 0.452648, -0.592584, 0.076142, 0.091738, -0.992868, 0.026866, 0.175416, -0.984128, 0.026866, 0.175416, -0.984128, -0.656863, 0.491783, -0.571560, -0.666299, 0.452648, -0.592584, -0.656863, 0.491783, -0.571560, 0.026866, 0.175416, -0.984128, 0.232530, 0.131167, -0.963704, 0.232530, 0.131167, -0.963704, -0.310860, 0.703454, -0.639154, -0.656863, 0.491783, -0.571560, -0.310860, 0.703454, -0.639154, 0.232530, 0.131167, -0.963704, 0.213926, -0.012188, -0.976774, 0.213926, -0.012188, -0.976774, -0.161604, 0.712457, -0.682854, -0.310860, 0.703454, -0.639154, -0.161604, 0.712457, -0.682854, 0.213926, -0.012188, -0.976774, 0.117970, -0.104411, -0.987513, -0.430840, 0.471468, -0.769477, -0.879898, 0.475138, -0.004923, -0.765628, 0.643279, -0.002581, -0.879898, 0.475138, -0.004923, -0.430840, 0.471468, -0.769477, -0.666299, 0.452648, -0.592584, -0.666299, 0.452648, -0.592584, -0.871328, 0.490660, 0.006310, -0.879898, 0.475138, -0.004923, -0.871328, 0.490660, 0.006310, -0.666299, 0.452648, -0.592584, -0.656863, 0.491783, -0.571560, -0.656863, 0.491783, -0.571560, -0.480573, 0.876820, 0.015360, -0.871328, 0.490660, 0.006310, -0.480573, 0.876820, 0.015360, -0.656863, 0.491783, -0.571560, -0.310860, 0.703454, -0.639154, -0.310860, 0.703454, -0.639154, -0.231314, 0.972872, 0.003798, -0.480573, 0.876820, 0.015360, -0.231314, 0.972872, 0.003798, -0.310860, 0.703454, -0.639154, -0.161604, 0.712457, -0.682854, -0.256249, 0.705669, -0.660582, -0.283774, 0.958827, 0.011083, -0.371437, 0.928447, 0.004621, -0.267304, 0.900903, -0.341939, 0.296481, 0.955026, -0.004863, 0.149542, 0.965755, 0.212026, 0.568783, -0.822483, -0.002883, 0.478447, -0.609791, 0.631858, 0.634168, -0.773090, 0.012772, 0.121832, -0.001342, -0.992550, -0.081657, 0.626867, -0.774835, -0.016015, 0.989816, 0.141447, 0.074234, 0.332446, 0.940196, 0.538555, -0.566575, 0.623660, 0.850745, -0.525575, 0.001884, 0.702954, -0.330830, 0.629609, 0.920134, -0.391587, -0.003578, 0.528218, -0.565644, -0.633271, 0.333168, 0.166962, -0.927967, -0.067443, 0.992247, 0.104386, -0.272752, 0.768932, 0.578231, 0.090776, 0.041135, 0.995021, 0.054904, 0.151494, 0.986932, 0.827601, -0.293850, 0.478257, 0.626211, -0.779643, -0.004147, 0.708100, -0.704670, -0.045098, 0.921582, -0.385101, -0.048818, -0.136129, 0.990682, 0.004263, -0.449938, 0.893060, -0.000478, -0.404862, 0.488251, 0.773109, -0.648093, 0.437042, 0.623674, 0.252514, 0.126465, 0.959293, 0.542732, -0.555721, 0.629775, 0.377835, 0.126873, 0.917139, -0.070259, 0.992387, -0.101148, -0.274720, 0.771791, -0.573470, -0.765628, 0.643279, -0.002581, -0.879898, 0.475138, -0.004923, -0.642436, 0.483889, 0.594245, 0.120585, 0.010299, 0.992650, -0.069849, 0.629904, 0.773525, -0.023213, 0.988826, -0.147259, 0.056461, 0.375568, -0.925074, -0.430840, 0.471468, -0.769477, -0.249339, 0.684868, 0.684679, -0.259153, 0.900351, 0.349582, 0.131171, 0.967362, -0.216805, 0.483106, -0.561413, -0.671881, 0.076142, 0.091738, -0.992868, -0.371437, 0.928447, 0.004621, -0.283774, 0.958827, 0.011083, 0.296481, 0.955026, -0.004863, 0.568783, -0.822483, -0.002883, 0.548239, -0.536344, -0.641692, 0.634168, -0.773090, 0.012772, 0.686239, -0.341396, -0.642281, 0.850745, -0.525575, 0.001884, 0.822048, -0.288177, -0.491112, 0.920134, -0.391587, -0.003578, 0.557512, -0.632921, -0.537207, 0.626211, -0.779643, -0.004147, -0.871328, 0.490660, 0.006310, -0.295351, 0.693673, 0.656952, 0.214724, -0.021267, 0.976443, 0.557085, -0.639038, 0.530364, 0.410930, -0.911586, -0.012123, -0.480573, 0.876820, 0.015360, -0.143482, 0.713864, 0.685428, 0.127072, -0.113283, 0.985403, 0.356930, -0.767989, 0.531784, -0.231314, 0.972872, 0.003798 }; // Texture coords #ifdef EXTEAPOT_ENABLETEXCOORDS static const double ExTeapotSpoutTexCoords[149 * 2] = { 1.000000, -0.225000, 0.875000, 0.000000, 0.875000, -0.225000, 0.875000, 0.000000, 1.000000, -0.225000, 1.000000, 0.000000, 0.875000, -0.900000, 0.750000, -0.675000, 0.750000, -0.900000, 0.750000, -0.675000, 0.875000, -0.900000, 0.875000, -0.675000, 0.875000, -0.675000, 0.750000, -0.450000, 0.750000, -0.675000, 0.750000, -0.450000, 0.875000, -0.675000, 0.875000, -0.450000, 0.875000, -0.450000, 0.750000, -0.225000, 0.750000, -0.450000, 0.750000, -0.225000, 0.875000, -0.450000, 0.875000, -0.225000, 0.875000, -0.225000, 0.750000, 0.000000, 0.750000, -0.225000, 0.750000, 0.000000, 0.875000, -0.225000, 0.875000, 0.000000, 0.750000, -0.900000, 0.625000, -0.675000, 0.625000, -0.900000, 0.625000, -0.675000, 0.750000, -0.900000, 0.750000, -0.675000, 0.750000, -0.675000, 0.625000, -0.450000, 0.625000, -0.675000, 0.625000, -0.450000, 0.750000, -0.675000, 0.750000, -0.450000, 0.750000, -0.450000, 0.625000, -0.225000, 0.625000, -0.450000, 0.625000, -0.225000, 0.750000, -0.450000, 0.750000, -0.225000, 0.750000, -0.225000, 0.625000, 0.000000, 0.625000, -0.225000, 0.625000, 0.000000, 0.750000, -0.225000, 0.750000, 0.000000, 0.625000, -0.900000, 0.500000, -0.675000, 0.500000, -0.900000, 0.500000, -0.675000, 0.625000, -0.900000, 0.625000, -0.675000, 0.625000, -0.675000, 0.500000, -0.450000, 0.500000, -0.675000, 0.500000, -0.450000, 0.625000, -0.675000, 0.625000, -0.450000, 0.625000, -0.450000, 0.500000, -0.225000, 0.500000, -0.450000, 0.500000, -0.225000, 0.625000, -0.450000, 0.625000, -0.225000, 0.625000, -0.225000, 0.500000, 0.000000, 0.500000, -0.225000, 0.500000, 0.000000, 0.625000, -0.225000, 0.625000, 0.000000, 0.125000, -1.000000, 0.000000, -0.975000, 0.000000, -1.000000, 0.125000, -0.975000, 0.000000, -0.950000, 0.125000, -0.950000, 0.000000, -0.925000, 0.125000, -0.925000, 0.000000, -0.900000, 0.250000, -1.000000, 0.250000, -0.975000, 0.250000, -0.950000, 0.250000, -0.925000, 0.125000, -0.900000, 0.000000, -0.675000, 0.125000, -0.675000, 0.000000, -0.450000, 0.375000, -1.000000, 0.375000, -0.975000, 0.375000, -0.950000, 0.375000, -0.925000, 0.250000, -0.900000, 0.250000, -0.675000, 0.125000, -0.450000, 0.000000, -0.225000, 0.500000, -1.000000, 0.500000, -0.975000, 0.500000, -0.950000, 0.500000, -0.925000, 0.375000, -0.900000, 0.375000, -0.675000, 0.250000, -0.450000, 0.625000, -1.000000, 0.625000, -0.975000, 0.625000, -0.950000, 0.625000, -0.925000, 0.500000, -0.900000, 0.500000, -0.675000, 0.375000, -0.450000, 0.750000, -1.000000, 0.750000, -0.975000, 0.750000, -0.950000, 0.750000, -0.925000, 0.625000, -0.900000, 0.875000, -1.000000, 0.875000, -0.975000, 0.875000, -0.950000, 0.875000, -0.925000, 0.750000, -0.900000, 1.000000, -1.000000, 1.000000, -0.975000, 1.000000, -0.950000, 1.000000, -0.925000, 0.875000, -0.900000, 1.000000, -0.900000, 0.875000, -0.675000, 1.000000, -0.675000, 0.875000, -0.450000, 1.000000, -0.450000, 0.875000, -0.225000, 1.000000, -0.225000, 0.500000, -0.450000, 0.375000, -0.225000, 0.250000, -0.225000, 0.125000, -0.225000, 0.000000, 0.000000, 0.500000, -0.225000, 0.375000, 0.000000, 0.250000, 0.000000, 0.125000, 0.000000, 0.500000, 0.000000 }; #endif // EXTEAPOT_ENABLETEXCOORDS // TeapotLid data // Vertices static const double ExTeapotLidVertices[252 * 3] = { 0.000000, 1.575000, 0.000000, 0.170313, 1.550391, 0.000000, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, 0.157173, 1.550391, 0.067026, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, 0.121080, 1.550391, 0.121080, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, 0.067026, 1.550391, 0.157173, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, 0.000000, 1.550391, 0.170313, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.067026, 1.550391, 0.157173, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.121080, 1.550391, 0.121080, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.157173, 1.550391, 0.067026, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.170313, 1.550391, 0.000000, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.157173, 1.550391, -0.067026, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.121080, 1.550391, -0.121080, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.067026, 1.550391, -0.157173, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, 0.000000, 1.550391, -0.170313, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, 0.067026, 1.550391, -0.157173, 0.000000, 1.575000, 0.000000, 0.071000, 1.350000, -0.071000, 0.090828, 1.416797, -0.038696, 0.092250, 1.350000, -0.039250, 0.090828, 1.416797, -0.038696, 0.071000, 1.350000, -0.071000, 0.069943, 1.416797, -0.069943, 0.069943, 1.416797, -0.069943, 0.149959, 1.490625, -0.063939, 0.090828, 1.416797, -0.038696, 0.149959, 1.490625, -0.063939, 0.069943, 1.416797, -0.069943, 0.115516, 1.490625, -0.115516, 0.115516, 1.490625, -0.115516, 0.157173, 1.550391, -0.067026, 0.149959, 1.490625, -0.063939, 0.157173, 1.550391, -0.067026, 0.115516, 1.490625, -0.115516, 0.121080, 1.550391, -0.121080, 0.121080, 1.550391, -0.121080, 0.000000, 1.575000, 0.000000, 0.157173, 1.550391, -0.067026, 0.000000, 1.575000, 0.000000, 0.121080, 1.550391, -0.121080, 0.000000, 1.575000, 0.000000, 0.092250, 1.350000, -0.039250, 0.098438, 1.416797, 0.000000, 0.100000, 1.350000, 0.000000, 0.098438, 1.416797, 0.000000, 0.092250, 1.350000, -0.039250, 0.090828, 1.416797, -0.038696, 0.090828, 1.416797, -0.038696, 0.162500, 1.490625, 0.000000, 0.098438, 1.416797, 0.000000, 0.162500, 1.490625, 0.000000, 0.090828, 1.416797, -0.038696, 0.149959, 1.490625, -0.063939, 0.149959, 1.490625, -0.063939, 0.170313, 1.550391, 0.000000, 0.162500, 1.490625, 0.000000, 0.170313, 1.550391, 0.000000, 0.149959, 1.490625, -0.063939, 0.157173, 1.550391, -0.067026, 0.157173, 1.550391, -0.067026, 0.000000, 1.575000, 0.000000, 0.170313, 1.550391, 0.000000, 0.000000, 1.575000, 0.000000, 0.157173, 1.550391, -0.067026, 0.000000, 1.575000, 0.000000, 0.092250, 1.350000, 0.039250, 0.228125, 1.305469, 0.000000, 0.100000, 1.350000, 0.000000, 0.210445, 1.305469, 0.089539, 0.412500, 1.275000, 0.000000, 0.380531, 1.275000, 0.161906, 0.578125, 1.244531, 0.000000, 0.533320, 1.244531, 0.226914, 0.650000, 1.200000, 0.000000, 0.599625, 1.200000, 0.255125, 0.071000, 1.350000, 0.071000, 0.161969, 1.305469, 0.161969, 0.292875, 1.275000, 0.292875, 0.410469, 1.244531, 0.410469, 0.461500, 1.200000, 0.461500, 0.226914, 1.244531, 0.533320, 0.255125, 1.200000, 0.599625, 0.039250, 1.350000, 0.092250, 0.089539, 1.305469, 0.210445, 0.161906, 1.275000, 0.380531, 0.000000, 1.275000, 0.412500, 0.000000, 1.244531, 0.578125, 0.000000, 1.200000, 0.650000, -0.226914, 1.244531, 0.533320, -0.255125, 1.200000, 0.599625, 0.000000, 1.350000, 0.100000, 0.000000, 1.305469, 0.228125, -0.089539, 1.305469, 0.210445, -0.161906, 1.275000, 0.380531, -0.292875, 1.275000, 0.292875, -0.410469, 1.244531, 0.410469, -0.461500, 1.200000, 0.461500, -0.039250, 1.350000, 0.092250, -0.071000, 1.350000, 0.071000, -0.161969, 1.305469, 0.161969, -0.210445, 1.305469, 0.089539, -0.380531, 1.275000, 0.161906, -0.533320, 1.244531, 0.226914, -0.599625, 1.200000, 0.255125, -0.578125, 1.244531, 0.000000, -0.650000, 1.200000, 0.000000, -0.092250, 1.350000, 0.039250, -0.100000, 1.350000, 0.000000, -0.228125, 1.305469, 0.000000, -0.412500, 1.275000, 0.000000, -0.092250, 1.350000, -0.039250, -0.228125, 1.305469, 0.000000, -0.100000, 1.350000, 0.000000, -0.210445, 1.305469, -0.089539, -0.412500, 1.275000, 0.000000, -0.380531, 1.275000, -0.161906, -0.578125, 1.244531, 0.000000, -0.533320, 1.244531, -0.226914, -0.650000, 1.200000, 0.000000, -0.599625, 1.200000, -0.255125, -0.071000, 1.350000, -0.071000, -0.161969, 1.305469, -0.161969, -0.292875, 1.275000, -0.292875, -0.410469, 1.244531, -0.410469, -0.461500, 1.200000, -0.461500, -0.226914, 1.244531, -0.533320, -0.255125, 1.200000, -0.599625, -0.039250, 1.350000, -0.092250, -0.089539, 1.305469, -0.210445, -0.161906, 1.275000, -0.380531, 0.000000, 1.275000, -0.412500, 0.000000, 1.244531, -0.578125, 0.000000, 1.200000, -0.650000, 0.226914, 1.244531, -0.533320, 0.255125, 1.200000, -0.599625, 0.000000, 1.350000, -0.100000, 0.000000, 1.305469, -0.228125, 0.089539, 1.305469, -0.210445, 0.161906, 1.275000, -0.380531, 0.292875, 1.275000, -0.292875, 0.410469, 1.244531, -0.410469, 0.461500, 1.200000, -0.461500, 0.039250, 1.350000, -0.092250, 0.071000, 1.350000, -0.071000, 0.161969, 1.305469, -0.161969, 0.210445, 1.305469, -0.089539, 0.380531, 1.275000, -0.161906, 0.533320, 1.244531, -0.226914, 0.599625, 1.200000, -0.255125, 0.578125, 1.244531, 0.000000, 0.650000, 1.200000, 0.000000, 0.092250, 1.350000, -0.039250, 0.100000, 1.350000, 0.000000, 0.228125, 1.305469, 0.000000, 0.412500, 1.275000, 0.000000, 0.170313, 1.550391, 0.000000, 0.000000, 1.575000, 0.000000, 0.157173, 1.550391, 0.067026, 0.162500, 1.490625, 0.000000, 0.149959, 1.490625, 0.063939, 0.098438, 1.416797, 0.000000, 0.090828, 1.416797, 0.038696, 0.100000, 1.350000, 0.000000, 0.092250, 1.350000, 0.039250, 0.069943, 1.416797, 0.069943, 0.071000, 1.350000, 0.071000, 0.121080, 1.550391, 0.121080, 0.115516, 1.490625, 0.115516, 0.063939, 1.490625, 0.149959, 0.038696, 1.416797, 0.090828, 0.039250, 1.350000, 0.092250, 0.000000, 1.416797, 0.098438, 0.000000, 1.350000, 0.100000, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, 0.067026, 1.550391, 0.157173, 0.000000, 1.550391, 0.170313, 0.000000, 1.490625, 0.162500, -0.063939, 1.490625, 0.149959, -0.038696, 1.416797, 0.090828, -0.039250, 1.350000, 0.092250, -0.069943, 1.416797, 0.069943, -0.071000, 1.350000, 0.071000, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.067026, 1.550391, 0.157173, -0.121080, 1.550391, 0.121080, -0.115516, 1.490625, 0.115516, -0.149959, 1.490625, 0.063939, -0.090828, 1.416797, 0.038696, -0.092250, 1.350000, 0.039250, -0.098438, 1.416797, 0.000000, -0.100000, 1.350000, 0.000000, 0.000000, 1.575000, 0.000000, -0.162500, 1.490625, 0.000000, -0.170313, 1.550391, 0.000000, -0.157173, 1.550391, 0.067026, 0.000000, 1.575000, 0.000000, 0.000000, 1.575000, 0.000000, -0.170313, 1.550391, 0.000000, -0.157173, 1.550391, -0.067026, -0.162500, 1.490625, 0.000000, -0.149959, 1.490625, -0.063939, -0.098438, 1.416797, 0.000000, -0.090828, 1.416797, -0.038696, -0.100000, 1.350000, 0.000000, -0.092250, 1.350000, -0.039250, -0.069943, 1.416797, -0.069943, -0.071000, 1.350000, -0.071000, -0.121080, 1.550391, -0.121080, -0.115516, 1.490625, -0.115516, -0.063939, 1.490625, -0.149959, -0.038696, 1.416797, -0.090828, -0.039250, 1.350000, -0.092250, 0.000000, 1.416797, -0.098438, 0.000000, 1.350000, -0.100000, -0.067026, 1.550391, -0.157173, 0.000000, 1.550391, -0.170313, 0.000000, 1.490625, -0.162500, 0.063939, 1.490625, -0.149959, 0.038696, 1.416797, -0.090828, 0.039250, 1.350000, -0.092250, 0.069943, 1.416797, -0.069943, 0.071000, 1.350000, -0.071000, 0.115516, 1.490625, -0.115516, 0.121080, 1.550391, -0.121080, 0.067026, 1.550391, -0.157173 }; // Indices static const OdInt32 ExTeapotLidIndices[256 * 4] = { 3, 0, 1, 2, 3, 3, 4, 5, 3, 6, 7, 8, 3, 9, 10, 11, 3, 12, 13, 14, 3, 15, 16, 17, 3, 18, 19, 20, 3, 21, 22, 23, 3, 24, 25, 26, 3, 27, 28, 29, 3, 30, 31, 32, 3, 33, 34, 35, 3, 36, 37, 38, 3, 39, 40, 41, 3, 42, 43, 44, 3, 45, 46, 47, 3, 48, 49, 50, 3, 51, 52, 53, 3, 54, 55, 56, 3, 57, 58, 59, 3, 60, 61, 62, 3, 63, 64, 65, 3, 66, 67, 68, 3, 69, 70, 71, 3, 72, 73, 74, 3, 75, 76, 77, 3, 78, 79, 80, 3, 81, 82, 83, 3, 84, 85, 86, 3, 87, 88, 89, 3, 90, 91, 92, 3, 91, 90, 93, 3, 93, 94, 91, 3, 94, 93, 95, 3, 95, 96, 94, 3, 96, 95, 97, 3, 97, 98, 96, 3, 98, 97, 99, 3, 100, 93, 90, 3, 93, 100, 101, 3, 101, 95, 93, 3, 95, 101, 102, 3, 102, 97, 95, 3, 97, 102, 103, 3, 103, 99, 97, 3, 99, 103, 104, 3, 105, 104, 103, 3, 104, 105, 106, 3, 107, 101, 100, 3, 101, 107, 108, 3, 108, 102, 101, 3, 102, 108, 109, 3, 109, 103, 102, 3, 103, 109, 105, 3, 110, 105, 109, 3, 105, 110, 111, 3, 111, 106, 105, 3, 106, 111, 112, 3, 113, 112, 111, 3, 112, 113, 114, 3, 115, 108, 107, 3, 108, 115, 116, 3, 116, 109, 108, 3, 109, 116, 110, 3, 117, 110, 116, 3, 110, 117, 118, 3, 118, 111, 110, 3, 111, 118, 113, 3, 119, 113, 118, 3, 113, 119, 120, 3, 120, 114, 113, 3, 114, 120, 121, 3, 122, 116, 115, 3, 116, 122, 117, 3, 123, 117, 122, 3, 117, 123, 124, 3, 124, 118, 117, 3, 118, 124, 119, 3, 125, 119, 124, 3, 119, 125, 126, 3, 126, 120, 119, 3, 120, 126, 127, 3, 127, 121, 120, 3, 121, 127, 128, 3, 129, 128, 127, 3, 128, 129, 130, 3, 131, 124, 123, 3, 124, 131, 125, 3, 132, 125, 131, 3, 125, 132, 133, 3, 133, 126, 125, 3, 126, 133, 134, 3, 134, 127, 126, 3, 127, 134, 129, 3, 135, 136, 137, 3, 136, 135, 138, 3, 138, 139, 136, 3, 139, 138, 140, 3, 140, 141, 139, 3, 141, 140, 142, 3, 142, 143, 141, 3, 143, 142, 144, 3, 145, 138, 135, 3, 138, 145, 146, 3, 146, 140, 138, 3, 140, 146, 147, 3, 147, 142, 140, 3, 142, 147, 148, 3, 148, 144, 142, 3, 144, 148, 149, 3, 150, 149, 148, 3, 149, 150, 151, 3, 152, 146, 145, 3, 146, 152, 153, 3, 153, 147, 146, 3, 147, 153, 154, 3, 154, 148, 147, 3, 148, 154, 150, 3, 155, 150, 154, 3, 150, 155, 156, 3, 156, 151, 150, 3, 151, 156, 157, 3, 158, 157, 156, 3, 157, 158, 159, 3, 160, 153, 152, 3, 153, 160, 161, 3, 161, 154, 153, 3, 154, 161, 155, 3, 162, 155, 161, 3, 155, 162, 163, 3, 163, 156, 155, 3, 156, 163, 158, 3, 164, 158, 163, 3, 158, 164, 165, 3, 165, 159, 158, 3, 159, 165, 166, 3, 167, 161, 160, 3, 161, 167, 162, 3, 168, 162, 167, 3, 162, 168, 169, 3, 169, 163, 162, 3, 163, 169, 164, 3, 170, 164, 169, 3, 164, 170, 171, 3, 171, 165, 164, 3, 165, 171, 172, 3, 172, 166, 165, 3, 166, 172, 173, 3, 174, 173, 172, 3, 173, 174, 175, 3, 176, 169, 168, 3, 169, 176, 170, 3, 177, 170, 176, 3, 170, 177, 178, 3, 178, 171, 170, 3, 171, 178, 179, 3, 179, 172, 171, 3, 172, 179, 174, 3, 180, 181, 182, 3, 182, 183, 180, 3, 183, 182, 184, 3, 184, 185, 183, 3, 185, 184, 186, 3, 186, 187, 185, 3, 187, 186, 188, 3, 189, 188, 186, 3, 188, 189, 190, 3, 191, 184, 182, 3, 184, 191, 192, 3, 192, 186, 184, 3, 186, 192, 189, 3, 193, 189, 192, 3, 189, 193, 194, 3, 194, 190, 189, 3, 190, 194, 195, 3, 196, 195, 194, 3, 195, 196, 197, 3, 182, 198, 191, 3, 191, 199, 200, 3, 200, 192, 191, 3, 192, 200, 193, 3, 201, 193, 200, 3, 193, 201, 202, 3, 202, 194, 193, 3, 194, 202, 196, 3, 203, 196, 202, 3, 196, 203, 204, 3, 204, 197, 196, 3, 197, 204, 205, 3, 206, 205, 204, 3, 205, 206, 207, 3, 200, 208, 201, 3, 201, 209, 210, 3, 210, 202, 201, 3, 202, 210, 203, 3, 211, 203, 210, 3, 203, 211, 212, 3, 212, 204, 203, 3, 204, 212, 206, 3, 213, 206, 212, 3, 206, 213, 214, 3, 214, 207, 206, 3, 207, 214, 215, 3, 216, 215, 214, 3, 215, 216, 217, 3, 210, 218, 211, 3, 214, 219, 216, 3, 219, 214, 213, 3, 213, 220, 219, 3, 220, 213, 221, 3, 221, 222, 220, 3, 212, 221, 213, 3, 221, 212, 211, 3, 211, 223, 221, 3, 224, 181, 225, 3, 225, 226, 224, 3, 226, 225, 227, 3, 227, 228, 226, 3, 228, 227, 229, 3, 229, 230, 228, 3, 230, 229, 231, 3, 232, 231, 229, 3, 231, 232, 233, 3, 234, 227, 225, 3, 227, 234, 235, 3, 235, 229, 227, 3, 229, 235, 232, 3, 236, 232, 235, 3, 232, 236, 237, 3, 237, 233, 232, 3, 233, 237, 238, 3, 239, 238, 237, 3, 238, 239, 240, 3, 225, 198, 234, 3, 234, 199, 241, 3, 241, 235, 234, 3, 235, 241, 236, 3, 242, 236, 241, 3, 236, 242, 243, 3, 243, 237, 236, 3, 237, 243, 239, 3, 244, 239, 243, 3, 239, 244, 245, 3, 245, 240, 239, 3, 240, 245, 246, 3, 247, 246, 245, 3, 246, 247, 248, 3, 241, 208, 242, 3, 245, 249, 247, 3, 249, 245, 244, 3, 244, 250, 249, 3, 250, 244, 251, 3, 251, 218, 250, 3, 243, 251, 244, 3, 251, 243, 242, 3, 242, 209, 251 }; // Normals static const double ExTeapotLidNormals[252 * 3] = { 0.000000, 1.000000, -0.000000, 0.489658, 0.871914, 0.000847, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, 0.452719, 0.872174, 0.185360, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, 0.344719, 0.872647, 0.345912, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, 0.183882, 0.872007, 0.453642, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.000847, 0.871914, 0.489658, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.185360, 0.872174, 0.452719, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.345912, 0.872647, 0.344719, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.453642, 0.872007, 0.183882, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.489658, 0.871914, -0.000847, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.452719, 0.872174, -0.185360, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.344719, 0.872647, -0.345912, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.183882, 0.872007, -0.453642, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, 0.000847, 0.871914, -0.489658, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, 0.185360, 0.872174, -0.452719, 0.000000, 1.000000, -0.000000, 0.404687, 0.812671, -0.419279, 0.836436, -0.438606, -0.328633, 0.536595, 0.811852, -0.230135, 0.836436, -0.438606, -0.328633, 0.404687, 0.812671, -0.419279, 0.642806, -0.438423, -0.628160, 0.642806, -0.438423, -0.628160, 0.827200, -0.454224, -0.330788, 0.836436, -0.438606, -0.328633, 0.827200, -0.454224, -0.330788, 0.642806, -0.438423, -0.628160, 0.633568, -0.455198, -0.625609, 0.633568, -0.455198, -0.625609, 0.453642, 0.872007, -0.183882, 0.827200, -0.454224, -0.330788, 0.453642, 0.872007, -0.183882, 0.633568, -0.455198, -0.625609, 0.345912, 0.872647, -0.344719, 0.345912, 0.872647, -0.344719, 0.000000, 1.000000, -0.000000, 0.453642, 0.872007, -0.183882, 0.000000, 1.000000, -0.000000, 0.345912, 0.872647, -0.344719, 0.000000, 1.000000, -0.000000, 0.536595, 0.811852, -0.230135, 0.899515, -0.436764, 0.010523, 0.582610, 0.812681, -0.010740, 0.899515, -0.436764, 0.010523, 0.536595, 0.811852, -0.230135, 0.836436, -0.438606, -0.328633, 0.836436, -0.438606, -0.328633, 0.891518, -0.452949, 0.005752, 0.899515, -0.436764, 0.010523, 0.891518, -0.452949, 0.005752, 0.836436, -0.438606, -0.328633, 0.827200, -0.454224, -0.330788, 0.827200, -0.454224, -0.330788, 0.489658, 0.871914, 0.000847, 0.891518, -0.452949, 0.005752, 0.489658, 0.871914, 0.000847, 0.827200, -0.454224, -0.330788, 0.453642, 0.872007, -0.183882, 0.453642, 0.872007, -0.183882, 0.000000, 1.000000, -0.000000, 0.489658, 0.871914, 0.000847, 0.000000, 1.000000, -0.000000, 0.453642, 0.872007, -0.183882, 0.000000, 1.000000, -0.000000, 0.541783, 0.814041, 0.209303, 0.215445, 0.976505, -0.004631, 0.582610, 0.812681, -0.010740, 0.200657, 0.976631, 0.077004, 0.173435, 0.984840, -0.003223, 0.161453, 0.984902, 0.062462, 0.330580, 0.943771, -0.003731, 0.306956, 0.943963, 0.121294, 0.526667, 0.850059, -0.004604, 0.488250, 0.850606, 0.195145, 0.419279, 0.812671, 0.404687, 0.155096, 0.976631, 0.148784, 0.124346, 0.984965, 0.119929, 0.235371, 0.944249, 0.230204, 0.374522, 0.851020, 0.368100, 0.128206, 0.943962, 0.304137, 0.203663, 0.850660, 0.484663, 0.230135, 0.811852, 0.536595, 0.085586, 0.976587, 0.197367, 0.068360, 0.984920, 0.158930, 0.003223, 0.984840, 0.173435, 0.003731, 0.943771, 0.330580, 0.004604, 0.850059, 0.526667, -0.121294, 0.943963, 0.306956, -0.195145, 0.850606, 0.488250, 0.010740, 0.812681, 0.582610, 0.004631, 0.976505, 0.215445, -0.077004, 0.976631, 0.200657, -0.062462, 0.984902, 0.161453, -0.119929, 0.984965, 0.124346, -0.230204, 0.944249, 0.235371, -0.368100, 0.851020, 0.374522, -0.209303, 0.814041, 0.541783, -0.404687, 0.812671, 0.419279, -0.148784, 0.976631, 0.155096, -0.197367, 0.976587, 0.085586, -0.158930, 0.984920, 0.068360, -0.304137, 0.943962, 0.128206, -0.484663, 0.850660, 0.203663, -0.330580, 0.943771, 0.003731, -0.526667, 0.850059, 0.004604, -0.536595, 0.811852, 0.230135, -0.582610, 0.812681, 0.010740, -0.215445, 0.976505, 0.004631, -0.173435, 0.984840, 0.003223, -0.541783, 0.814041, -0.209303, -0.215445, 0.976505, 0.004631, -0.582610, 0.812681, 0.010740, -0.200657, 0.976631, -0.077004, -0.173435, 0.984840, 0.003223, -0.161453, 0.984902, -0.062462, -0.330580, 0.943771, 0.003731, -0.306956, 0.943963, -0.121294, -0.526667, 0.850059, 0.004604, -0.488250, 0.850606, -0.195145, -0.419279, 0.812671, -0.404687, -0.155096, 0.976631, -0.148784, -0.124346, 0.984965, -0.119929, -0.235371, 0.944249, -0.230204, -0.374522, 0.851020, -0.368100, -0.128206, 0.943962, -0.304137, -0.203663, 0.850660, -0.484663, -0.230135, 0.811852, -0.536595, -0.085586, 0.976587, -0.197367, -0.068360, 0.984920, -0.158930, -0.003223, 0.984840, -0.173435, -0.003731, 0.943771, -0.330580, -0.004604, 0.850059, -0.526667, 0.121294, 0.943963, -0.306956, 0.195145, 0.850606, -0.488250, -0.010740, 0.812681, -0.582610, -0.004631, 0.976505, -0.215445, 0.077004, 0.976631, -0.200657, 0.062462, 0.984902, -0.161453, 0.119929, 0.984965, -0.124346, 0.230204, 0.944249, -0.235371, 0.368100, 0.851020, -0.374522, 0.209303, 0.814041, -0.541783, 0.404687, 0.812671, -0.419279, 0.148784, 0.976631, -0.155096, 0.197367, 0.976587, -0.085586, 0.158930, 0.984920, -0.068360, 0.304137, 0.943962, -0.128206, 0.484663, 0.850660, -0.203663, 0.330580, 0.943771, -0.003731, 0.526667, 0.850059, -0.004604, 0.536595, 0.811852, -0.230135, 0.582610, 0.812681, -0.010740, 0.215445, 0.976505, -0.004631, 0.173435, 0.984840, -0.003223, 0.489658, 0.871914, 0.000847, 0.000000, 1.000000, -0.000000, 0.452719, 0.872174, 0.185360, 0.891518, -0.452949, 0.005752, 0.823029, -0.453842, 0.341541, 0.899515, -0.436764, 0.010523, 0.829099, -0.437190, 0.348512, 0.582610, 0.812681, -0.010740, 0.541783, 0.814041, 0.209303, 0.628160, -0.438423, 0.642806, 0.419279, 0.812671, 0.404687, 0.344719, 0.872647, 0.345912, 0.625609, -0.455198, 0.633568, 0.330788, -0.454224, 0.827200, 0.328633, -0.438606, 0.836436, 0.230135, 0.811852, 0.536595, -0.010523, -0.436764, 0.899515, 0.010740, 0.812681, 0.582610, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, 0.183882, 0.872007, 0.453642, -0.000847, 0.871914, 0.489658, -0.005752, -0.452949, 0.891518, -0.341541, -0.453842, 0.823029, -0.348512, -0.437190, 0.829099, -0.209303, 0.814041, 0.541783, -0.642806, -0.438423, 0.628160, -0.404687, 0.812671, 0.419279, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.185360, 0.872174, 0.452719, -0.345912, 0.872647, 0.344719, -0.633568, -0.455198, 0.625609, -0.827200, -0.454224, 0.330788, -0.836436, -0.438606, 0.328633, -0.536595, 0.811852, 0.230135, -0.899515, -0.436764, -0.010523, -0.582610, 0.812681, 0.010740, 0.000000, 1.000000, -0.000000, -0.891518, -0.452949, -0.005752, -0.489658, 0.871914, -0.000847, -0.453642, 0.872007, 0.183882, 0.000000, 1.000000, -0.000000, 0.000000, 1.000000, -0.000000, -0.489658, 0.871914, -0.000847, -0.452719, 0.872174, -0.185360, -0.891518, -0.452949, -0.005752, -0.823029, -0.453842, -0.341541, -0.899515, -0.436764, -0.010523, -0.829099, -0.437190, -0.348512, -0.582610, 0.812681, 0.010740, -0.541783, 0.814041, -0.209303, -0.628160, -0.438423, -0.642806, -0.419279, 0.812671, -0.404687, -0.344719, 0.872647, -0.345912, -0.625609, -0.455198, -0.633568, -0.330788, -0.454224, -0.827200, -0.328633, -0.438606, -0.836436, -0.230135, 0.811852, -0.536595, 0.010523, -0.436764, -0.899515, -0.010740, 0.812681, -0.582610, -0.183882, 0.872007, -0.453642, 0.000847, 0.871914, -0.489658, 0.005752, -0.452949, -0.891518, 0.341541, -0.453842, -0.823029, 0.348512, -0.437190, -0.829099, 0.209303, 0.814041, -0.541783, 0.642806, -0.438423, -0.628160, 0.404687, 0.812671, -0.419279, 0.633568, -0.455198, -0.625609, 0.345912, 0.872647, -0.344719, 0.185360, 0.872174, -0.452719 }; // Texture coords #ifdef EXTEAPOT_ENABLETEXCOORDS static const double ExTeapotLidTexCoords[252 * 2] = { 0.125000, -1.000000, 0.000000, -0.750000, 0.000000, -1.000000, 0.250000, -1.000000, 0.125000, -0.750000, 0.125000, -1.000000, 0.375000, -1.000000, 0.250000, -0.750000, 0.250000, -1.000000, 0.500000, -1.000000, 0.375000, -0.750000, 0.375000, -1.000000, 0.625000, -1.000000, 0.500000, -0.750000, 0.500000, -1.000000, 0.750000, -1.000000, 0.625000, -0.750000, 0.625000, -1.000000, 0.875000, -1.000000, 0.750000, -0.750000, 0.750000, -1.000000, 1.000000, -1.000000, 0.875000, -0.750000, 0.875000, -1.000000, 0.125000, -1.000000, 0.000000, -0.750000, 0.000000, -1.000000, 0.250000, -1.000000, 0.125000, -0.750000, 0.125000, -1.000000, 0.375000, -1.000000, 0.250000, -0.750000, 0.250000, -1.000000, 0.500000, -1.000000, 0.375000, -0.750000, 0.375000, -1.000000, 0.625000, -1.000000, 0.500000, -0.750000, 0.500000, -1.000000, 0.750000, -1.000000, 0.625000, -0.750000, 0.625000, -1.000000, 0.750000, 0.000000, 0.875000, -0.250000, 0.875000, 0.000000, 0.875000, -0.250000, 0.750000, 0.000000, 0.750000, -0.250000, 0.750000, -0.250000, 0.875000, -0.500000, 0.875000, -0.250000, 0.875000, -0.500000, 0.750000, -0.250000, 0.750000, -0.500000, 0.750000, -0.500000, 0.875000, -0.750000, 0.875000, -0.500000, 0.875000, -0.750000, 0.750000, -0.500000, 0.750000, -0.750000, 0.750000, -0.750000, 0.875000, -1.000000, 0.875000, -0.750000, 0.875000, -1.000000, 0.750000, -0.750000, 0.750000, -1.000000, 0.875000, 0.000000, 1.000000, -0.250000, 1.000000, 0.000000, 1.000000, -0.250000, 0.875000, 0.000000, 0.875000, -0.250000, 0.875000, -0.250000, 1.000000, -0.500000, 1.000000, -0.250000, 1.000000, -0.500000, 0.875000, -0.250000, 0.875000, -0.500000, 0.875000, -0.500000, 1.000000, -0.750000, 1.000000, -0.500000, 1.000000, -0.750000, 0.875000, -0.500000, 0.875000, -0.750000, 0.875000, -0.750000, 1.000000, -1.000000, 1.000000, -0.750000, 1.000000, -1.000000, 0.875000, -0.750000, 0.875000, -1.000000, 0.125000, -1.000000, 0.000000, -0.750000, 0.000000, -1.000000, 0.125000, -0.750000, 0.000000, -0.500000, 0.125000, -0.500000, 0.000000, -0.250000, 0.125000, -0.250000, 0.000000, 0.000000, 0.125000, 0.000000, 0.250000, -1.000000, 0.250000, -0.750000, 0.250000, -0.500000, 0.250000, -0.250000, 0.250000, 0.000000, 0.375000, -0.250000, 0.375000, 0.000000, 0.375000, -1.000000, 0.375000, -0.750000, 0.375000, -0.500000, 0.500000, -0.500000, 0.500000, -0.250000, 0.500000, 0.000000, 0.625000, -0.250000, 0.625000, 0.000000, 0.500000, -1.000000, 0.500000, -0.750000, 0.625000, -0.750000, 0.625000, -0.500000, 0.750000, -0.500000, 0.750000, -0.250000, 0.750000, 0.000000, 0.625000, -1.000000, 0.750000, -1.000000, 0.750000, -0.750000, 0.875000, -0.750000, 0.875000, -0.500000, 0.875000, -0.250000, 0.875000, 0.000000, 1.000000, -0.250000, 1.000000, 0.000000, 0.875000, -1.000000, 1.000000, -1.000000, 1.000000, -0.750000, 1.000000, -0.500000, 0.125000, -1.000000, 0.000000, -0.750000, 0.000000, -1.000000, 0.125000, -0.750000, 0.000000, -0.500000, 0.125000, -0.500000, 0.000000, -0.250000, 0.125000, -0.250000, 0.000000, 0.000000, 0.125000, 0.000000, 0.250000, -1.000000, 0.250000, -0.750000, 0.250000, -0.500000, 0.250000, -0.250000, 0.250000, 0.000000, 0.375000, -0.250000, 0.375000, 0.000000, 0.375000, -1.000000, 0.375000, -0.750000, 0.375000, -0.500000, 0.500000, -0.500000, 0.500000, -0.250000, 0.500000, 0.000000, 0.625000, -0.250000, 0.625000, 0.000000, 0.500000, -1.000000, 0.500000, -0.750000, 0.625000, -0.750000, 0.625000, -0.500000, 0.750000, -0.500000, 0.750000, -0.250000, 0.750000, 0.000000, 0.625000, -1.000000, 0.750000, -1.000000, 0.750000, -0.750000, 0.875000, -0.750000, 0.875000, -0.500000, 0.875000, -0.250000, 0.875000, 0.000000, 1.000000, -0.250000, 1.000000, 0.000000, 0.875000, -1.000000, 1.000000, -1.000000, 1.000000, -0.750000, 1.000000, -0.500000, 0.000000, -0.750000, 0.125000, -1.000000, 0.125000, -0.750000, 0.000000, -0.500000, 0.125000, -0.500000, 0.000000, -0.250000, 0.125000, -0.250000, 0.000000, 0.000000, 0.125000, 0.000000, 0.250000, -0.250000, 0.250000, 0.000000, 0.250000, -0.750000, 0.250000, -0.500000, 0.375000, -0.500000, 0.375000, -0.250000, 0.375000, 0.000000, 0.500000, -0.250000, 0.500000, 0.000000, 0.250000, -1.000000, 0.375000, -1.000000, 0.375000, -0.750000, 0.500000, -0.750000, 0.500000, -0.500000, 0.625000, -0.500000, 0.625000, -0.250000, 0.625000, 0.000000, 0.750000, -0.250000, 0.750000, 0.000000, 0.500000, -1.000000, 0.625000, -1.000000, 0.625000, -0.750000, 0.750000, -0.750000, 0.750000, -0.500000, 0.875000, -0.500000, 0.875000, -0.250000, 0.875000, 0.000000, 1.000000, -0.250000, 1.000000, 0.000000, 0.750000, -1.000000, 1.000000, -0.500000, 1.000000, -0.750000, 0.875000, -0.750000, 1.000000, -1.000000, 0.875000, -1.000000, 0.000000, -0.750000, 0.125000, -0.750000, 0.000000, -0.500000, 0.125000, -0.500000, 0.000000, -0.250000, 0.125000, -0.250000, 0.000000, 0.000000, 0.125000, 0.000000, 0.250000, -0.250000, 0.250000, 0.000000, 0.250000, -0.750000, 0.250000, -0.500000, 0.375000, -0.500000, 0.375000, -0.250000, 0.375000, 0.000000, 0.500000, -0.250000, 0.500000, 0.000000, 0.375000, -0.750000, 0.500000, -0.750000, 0.500000, -0.500000, 0.625000, -0.500000, 0.625000, -0.250000, 0.625000, 0.000000, 0.750000, -0.250000, 0.750000, 0.000000, 0.750000, -0.500000, 0.750000, -0.750000, 0.625000, -0.750000 }; #endif // EXTEAPOT_ENABLETEXCOORDS class ExTeapot : public OdDgGraphicsElement { static const int lastKnownVersion; OdGePoint3d m_position; bool m_bDrawBody; bool m_bDrawHandle; bool m_bDrawSpout; bool m_bDrawLid; bool m_bDrawTexCoords; bool m_bInvertTexCoords; OdGeScale3d m_scale; OdGeVector3d m_rotate; public: ODDG_DECLARE_MEMBERS(ExTeapot); ExTeapot() : m_bDrawBody(true) , m_bDrawHandle(true) , m_bDrawSpout(true) , m_bDrawLid(true) , m_bDrawTexCoords(true) , m_bInvertTexCoords(true) { } ~ExTeapot() { } static int getVersion() { return lastKnownVersion; } OdGePoint3d position() const { assertReadEnabled(); return m_position; } void setPosition(const OdGePoint3d pos) { assertWriteEnabled(); m_position = pos; } bool drawBody() const { assertReadEnabled(); return m_bDrawBody; } void setDrawBody(bool bDraw) { assertWriteEnabled(); m_bDrawBody = bDraw; } bool drawHandle() const { assertReadEnabled(); return m_bDrawHandle; } void setDrawHandle(bool bDraw) { assertWriteEnabled(); m_bDrawHandle = bDraw; } bool drawSpout() const { assertReadEnabled(); return m_bDrawSpout; } void setDrawSpout(bool bDraw) { assertWriteEnabled(); m_bDrawSpout = bDraw; } bool drawLid() const { assertReadEnabled(); return m_bDrawLid; } void setDrawLid(bool bDraw) { assertWriteEnabled(); m_bDrawLid = bDraw; } bool drawTexCoords() const { assertReadEnabled(); return m_bDrawTexCoords; } void setDrawTexCoords(bool bDraw) { assertWriteEnabled(); m_bDrawTexCoords = bDraw; } bool invertTexCoords() const { assertReadEnabled(); return m_bInvertTexCoords; } void setInvertTexCoords(bool bInv) { assertWriteEnabled(); m_bInvertTexCoords = bInv; } OdGeScale3d scale() const { assertReadEnabled(); return m_scale; } void setScale(const OdGeScale3d scale) { assertWriteEnabled(); m_scale = scale; } OdGeVector3d rotate() const { assertReadEnabled(); return m_rotate; } void setRotate(const OdGeVector3d &rot) { assertWriteEnabled(); m_rotate = rot; } OdGeMatrix3d getTransform() const { assertReadEnabled(); return OdGeMatrix3d::translation(m_position.asVector()) * OdGeMatrix3d::rotation(m_rotate.x, OdGeVector3d::kXAxis) * OdGeMatrix3d::rotation(m_rotate.y, OdGeVector3d::kYAxis) * OdGeMatrix3d::rotation(m_rotate.z, OdGeVector3d::kZAxis) * OdGeMatrix3d::scaling(m_scale); } void setTransform(const OdGeMatrix3d &tm) { assertWriteEnabled(); OdGeVector3d xAxis, yAxis, zAxis; OdGePoint3d origin; tm.getCoordSystem(origin, xAxis, yAxis, zAxis); m_position = origin; m_scale.set(xAxis.normalizeGetLength(), yAxis.normalizeGetLength(), zAxis.normalizeGetLength()); m_rotate.set(OD_ATAN2(yAxis.z, zAxis.z), -OD_ASIN(xAxis.z), OD_ATAN2(xAxis.y, xAxis.x)); } OdResult subTransformBy(const OdGeMatrix3d& xform) { setTransform(xform * getTransform()); return eOk; } void makeCompatibleCoords(OdUInt32 numCoords, const double *pInCoords, OdGePoint3dArray &outCoords) const { outCoords.resize(numCoords); OdGePoint3d *pOut = outCoords.asArrayPtr(); if (m_bInvertTexCoords) { for (OdUInt32 nCoord = 0; nCoord < numCoords; nCoord++, pInCoords += 2, pOut++) pOut->set(pInCoords[0], 1.0 - pInCoords[1], 0.0); } else { for (OdUInt32 nCoord = 0; nCoord < numCoords; nCoord++, pInCoords += 2, pOut++) pOut->set(pInCoords[0], pInCoords[1], 0.0); } } bool subWorldDraw(OdGiWorldDraw* pWd) const { if (!m_bDrawBody && !m_bDrawHandle && !m_bDrawSpout && !m_bDrawLid) return true; OdGeMatrix3d tx = getTransform() * OdGeMatrix3d::rotation(OdaToRadian(90.0), OdGeVector3d::kXAxis) * OdGeMatrix3d::rotation(OdaToRadian(90.0), OdGeVector3d::kYAxis); pWd->geometry().pushModelTransform(tx); if (m_bDrawBody) { OdGiVertexData vData; vData.setNormals((const OdGeVector3d*)ExTeapotBodyNormals); #ifdef EXTEAPOT_ENABLETEXCOORDS OdGePoint3dArray mapCoords; if (m_bDrawTexCoords) { makeCompatibleCoords(sizeof(ExTeapotBodyTexCoords) / sizeof(double) / 2, ExTeapotBodyTexCoords, mapCoords); vData.setMappingCoords(OdGiVertexData::kAllChannels, mapCoords.getPtr()); } #endif pWd->geometry().shell(sizeof(ExTeapotBodyVertices) / sizeof(double) / 3, (const OdGePoint3d*)ExTeapotBodyVertices, sizeof(ExTeapotBodyIndices) / sizeof(OdInt32), ExTeapotBodyIndices, 0, 0, &vData); } if (m_bDrawHandle) { OdGiVertexData vData; vData.setNormals((const OdGeVector3d*)ExTeapotHandleNormals); #ifdef EXTEAPOT_ENABLETEXCOORDS OdGePoint3dArray mapCoords; if (m_bDrawTexCoords) { makeCompatibleCoords(sizeof(ExTeapotHandleTexCoords) / sizeof(double) / 2, ExTeapotHandleTexCoords, mapCoords); vData.setMappingCoords(OdGiVertexData::kAllChannels, mapCoords.getPtr()); } #endif pWd->geometry().shell(sizeof(ExTeapotHandleVertices) / sizeof(double) / 3, (const OdGePoint3d*)ExTeapotHandleVertices, sizeof(ExTeapotHandleIndices) / sizeof(OdInt32), ExTeapotHandleIndices, 0, 0, &vData); } if (m_bDrawSpout) { OdGiVertexData vData; vData.setNormals((const OdGeVector3d*)ExTeapotSpoutNormals); #ifdef EXTEAPOT_ENABLETEXCOORDS OdGePoint3dArray mapCoords; if (m_bDrawTexCoords) { makeCompatibleCoords(sizeof(ExTeapotSpoutTexCoords) / sizeof(double) / 2, ExTeapotSpoutTexCoords, mapCoords); vData.setMappingCoords(OdGiVertexData::kAllChannels, mapCoords.getPtr()); } #endif pWd->geometry().shell(sizeof(ExTeapotSpoutVertices) / sizeof(double) / 3, (const OdGePoint3d*)ExTeapotSpoutVertices, sizeof(ExTeapotSpoutIndices) / sizeof(OdInt32), ExTeapotSpoutIndices, 0, 0, &vData); } if (m_bDrawLid) { OdGiVertexData vData; vData.setNormals((const OdGeVector3d*)ExTeapotLidNormals); #ifdef EXTEAPOT_ENABLETEXCOORDS OdGePoint3dArray mapCoords; if (m_bDrawTexCoords) { makeCompatibleCoords(sizeof(ExTeapotLidTexCoords) / sizeof(double) / 2, ExTeapotLidTexCoords, mapCoords); vData.setMappingCoords(OdGiVertexData::kAllChannels, mapCoords.getPtr()); } #endif pWd->geometry().shell(sizeof(ExTeapotLidVertices) / sizeof(double) / 3, (const OdGePoint3d*)ExTeapotLidVertices, sizeof(ExTeapotLidIndices) / sizeof(OdInt32), ExTeapotLidIndices, 0, 0, &vData); } pWd->geometry().popModelTransform(); return true; } }; const int ExTeapot::lastKnownVersion = 1; ODRX_CONS_DEFINE_MEMBERS(ExTeapot, OdDgGraphicsElement, RXIMPL_CONSTR); class OdExTeapotCmd : public OdEdCommand { public: const OdString groupName() const { return OD_T("ODADGNAPP"); } const OdString globalName() const { return OD_T("ExTeapot"); } void execute(OdEdCommandContext* pCmdCtx) { OdDgCommandContextPtr pDbCmdCtx(pCmdCtx); OdDgDatabasePtr pDb = pDbCmdCtx->database(); OdSmartPtr pIO = pDbCmdCtx->userIO(); OdDgModelPtr pBTR = pDb->getActiveModelId().openObject(OdDg::kForWrite); OdSmartPtr pTeapot = ExTeapot::createObject(); pTeapot->setDatabaseDefaults(pDb); pTeapot->setPosition(pIO->getPoint(OD_T("\nSpecify center of teapot: "))); pTeapot->setScale(OdGeScale3d(pIO->getDist(OD_T("\nSpecify scale of teapot: ")))); pTeapot->setRotate(OdGeVector3d(0.0, 0.0, pIO->getAngle(OD_T("\nSpecify rotation angle around z-axis: ")))); pBTR->addElement(pTeapot); } }; static OdStaticRxObject g_OdExTeapotCmd; #ifdef _DEBUG // This is test for DGN-specific functionality (bug #7074) #include "Ge/GeEllipArc3d.h" class ExDgnSpecTObj : public OdDgGraphicsElement { public: enum Type { kTypeCircle = 0, kTypeEllipseSector, kTypeEllipseChord, kTypeEllipseSimple, kTypeCircArcSector, kTypeCircArcChord, kTypeCircArcSimple, kTypeEllipArcSector, kTypeEllipArcChord, kTypeEllipArcSimple, kTypePolygon, kTypeShell }; private: static const int lastKnownVersion; OdGePoint3d m_position; double m_radius; Type m_type; bool m_fillAlways; bool m_cFill; public: ODDG_DECLARE_MEMBERS(ExDgnSpecTObj); ExDgnSpecTObj() : m_radius(1.0) , m_type(kTypeCircle) , m_fillAlways(false) , m_cFill(false) { } ~ExDgnSpecTObj() { } static int getVersion() { return lastKnownVersion; } OdGePoint3d position() const { assertReadEnabled(); return m_position; } void setPosition(const OdGePoint3d pos) { assertWriteEnabled(); m_position = pos; } double radius() const { assertReadEnabled(); return m_radius; } void setRadius(double rad) { assertWriteEnabled(); m_radius = rad; } Type type() const { assertReadEnabled(); return m_type; } void setType(Type type) { assertWriteEnabled(); m_type = type; } bool fillAlways() const { assertReadEnabled(); return m_fillAlways; } void setFillAlways(bool fill) { assertWriteEnabled(); m_fillAlways = fill; } bool contourFill() const { assertReadEnabled(); return m_cFill; } void setContourFill(bool fill) { assertWriteEnabled(); m_cFill = fill; } OdResult subTransformBy(const OdGeMatrix3d& xform) { m_position.transformBy(xform); m_radius *= odmax(OdGeScale3d().extractScale(xform).sx, odmax(OdGeScale3d().extractScale(xform).sy, OdGeScale3d().extractScale(xform).sz)); return eOk; } bool subWorldDraw(OdGiWorldDraw* pWd) const { const double startAng = OdaToRadian(184.0), endAng = OdaToRadian(281.0); pWd->subEntityTraits().setFillType((m_fillAlways) ? kOdGiFillAlways : kOdGiFillNever); if (m_cFill) { pWd->subEntityTraits().setDrawFlags(OdGiSubEntityTraits::kDrawContourFill); pWd->subEntityTraits().setSecondaryTrueColor(OdCmEntityColor(0, 255, 0)); } switch (m_type) { case kTypeCircle: pWd->geometry().circle(m_position, m_radius, OdGeVector3d::kZAxis); break; case kTypeEllipseSector: pWd->geometry().ellipArc(OdGeEllipArc3d(m_position, OdGeVector3d(0.5, 0.5, 0.0).normal(), OdGeVector3d(-0.5, 0.5, 0.0).normal(), m_radius * 1.5, m_radius * 0.5), 0, kOdGiArcSector); break; case kTypeEllipseChord: pWd->geometry().ellipArc(OdGeEllipArc3d(m_position, OdGeVector3d(0.5, 0.5, 0.0).normal(), OdGeVector3d(-0.5, 0.5, 0.0).normal(), m_radius * 1.5, m_radius * 0.5), 0, kOdGiArcChord); break; case kTypeEllipseSimple: pWd->geometry().ellipArc(OdGeEllipArc3d(m_position, OdGeVector3d(0.5, 0.5, 0.0).normal(), OdGeVector3d(-0.5, 0.5, 0.0).normal(), m_radius * 1.5, m_radius * 0.5), 0, kOdGiArcSimple); break; case kTypeCircArcSector: pWd->geometry().circularArc(m_position, m_radius, OdGeVector3d::kZAxis, OdGeVector3d::kYAxis, endAng - startAng, kOdGiArcSector); break; case kTypeCircArcChord: pWd->geometry().circularArc(m_position, m_radius, OdGeVector3d::kZAxis, OdGeVector3d::kYAxis, endAng - startAng, kOdGiArcChord); break; case kTypeCircArcSimple: pWd->geometry().circularArc(m_position, m_radius, OdGeVector3d::kZAxis, OdGeVector3d::kYAxis, endAng - startAng, kOdGiArcSimple); break; case kTypeEllipArcSector: pWd->geometry().ellipArc(OdGeEllipArc3d(m_position, OdGeVector3d(0.5, 0.5, 0.0).normal(), OdGeVector3d(-0.5, 0.5, 0.0).normal(), m_radius * 1.5, m_radius * 0.5, startAng, endAng), 0, kOdGiArcSector); break; case kTypeEllipArcChord: pWd->geometry().ellipArc(OdGeEllipArc3d(m_position, OdGeVector3d(0.5, 0.5, 0.0).normal(), OdGeVector3d(-0.5, 0.5, 0.0).normal(), m_radius * 1.5, m_radius * 0.5, startAng, endAng), 0, kOdGiArcChord); break; case kTypeEllipArcSimple: pWd->geometry().ellipArc(OdGeEllipArc3d(m_position, OdGeVector3d(0.5, 0.5, 0.0).normal(), OdGeVector3d(-0.5, 0.5, 0.0).normal(), m_radius * 1.5, m_radius * 0.5, startAng, endAng), 0, kOdGiArcSimple); break; case kTypePolygon: { OdGePoint3d pt[4] = { m_position - OdGeVector3d::kYAxis * m_radius, m_position + OdGeVector3d::kXAxis * m_radius, m_position + OdGeVector3d::kYAxis * m_radius, m_position - OdGeVector3d::kXAxis * m_radius }; pWd->geometry().polygon(4, pt); OdGePoint3d pt2[3] = { m_position - OdGeVector3d::kYAxis * (m_radius * 0.5), m_position + OdGeVector3d::kXAxis * (m_radius * 0.5), m_position + OdGeVector3d::kYAxis * (m_radius * 0.5) }; pWd->geometry().polygon(3, pt2); } break; case kTypeShell: { OdGePoint3d pt[4] = { m_position - OdGeVector3d::kYAxis * m_radius, m_position + OdGeVector3d::kXAxis * m_radius, m_position + OdGeVector3d::kYAxis * m_radius, m_position - OdGeVector3d::kXAxis * m_radius }; const OdInt32 faces[5] = { 4, 0, 1, 2, 3 }; pWd->geometry().shell(4, pt, 5, faces); OdGePoint3d pt2[3] = { m_position - OdGeVector3d::kYAxis * (m_radius * 0.5), m_position + OdGeVector3d::kXAxis * (m_radius * 0.5), m_position + OdGeVector3d::kYAxis * (m_radius * 0.5) }; const OdInt32 faces2[4] = { 3, 0, 1, 2 }; pWd->geometry().shell(3, pt2, 4, faces2); } break; } return true; } }; const int ExDgnSpecTObj::lastKnownVersion = 1; ODRX_CONS_DEFINE_MEMBERS(ExDgnSpecTObj, OdDgGraphicsElement, RXIMPL_CONSTR); class OdExDgnSpecTObjCmd : public OdEdCommand { public: const OdString groupName() const { return OD_T("ODADGNAPP"); } const OdString globalName() const { return OD_T("ExDgnSpecTObj"); } void execute(OdEdCommandContext* pCmdCtx) { OdDgCommandContextPtr pDbCmdCtx(pCmdCtx); OdDgDatabasePtr pDb = pDbCmdCtx->database(); OdSmartPtr pIO = pDbCmdCtx->userIO(); //OdDbBlockTableRecordPtr pBTR = pDb->getActiveLayoutBTRId().openObject(OdDb::kForWrite); OdDgModelPtr pBTR = pDb->getActiveModelId().openObject(OdDg::kForWrite); // Populate ExDgnSpecTObj-objects double yOffset = 0.0, xOffset; for (int y = 0; y < 4; y++) { xOffset = 0.0; bool bFlag1 = false, bFlag2 = false; switch (y) { case 1: bFlag1 = true; break; case 2: bFlag2 = true; break; case 3: bFlag1 = bFlag2 = true; break; } for (int x = 0; x <= (int)ExDgnSpecTObj::kTypeShell; x++) { OdSmartPtr pObj = ExDgnSpecTObj::createObject(); pObj->setDatabaseDefaults(pDb); pObj->setPosition(OdGePoint3d(xOffset, yOffset, 0.0)); pObj->setRadius(1.0); pObj->setType((ExDgnSpecTObj::Type)x); pObj->setFillAlways(bFlag1); pObj->setContourFill(bFlag2); pBTR->addElement(pObj); xOffset += 3.0; } yOffset += 3.0; } } }; static OdStaticRxObject g_OdExDgnSpecTObjCmd; #endif // #3764-related class OdExScaledArrayCmd : public OdEdCommand { public: const OdString groupName() const { return OD_T("ODAMFCAPP"); } const OdString globalName() const { return OD_T("ExScaledArray"); } void execute(OdEdCommandContext* pCmdCtx) { OdDgCommandContextPtr pDbCmdCtx(pCmdCtx); OdDgDatabasePtr pDb = pDbCmdCtx->database(); OdSmartPtr pIO = pDbCmdCtx->userIO(); OdDgModelPtr pBTR = pDb->getActiveModelId().openObject(OdDg::kForWrite); OdGsViewPtr pGsView = pDb->getActiveViewGroupId().openObject(OdDg::kForWrite); OdDgSelectionSetPtr pSSet = pIO->select(pGsView); if (pSSet->numEntities() > 0) { bool bMult = (0 == pIO->getKeyword(OD_T("Specify scale method [Diff/Mult]:"), OD_T("Mult Diff"))); double dFactor = pIO->getDist(OD_T("Specify scale factor:")); int nCount = pIO->getInt(OD_T("Set count of iterations:")); OdDgSelectionSetIteratorPtr pIter = pSSet->newIterator(); for (; !pIter->done(); pIter->next()) { OdRxObjectPtr pObj = pIter->objectId().safeOpenObject(); OdGeExtents3d ext; OdDgElement::cast(pObj)->getGeomExtents(ext); double inFac = 1.0; for (int i = 0; i < nCount; i++) { OdRxObjectPtr pCopy = pObj->clone(); OdDgElementPtr pEnt = pCopy; pBTR->addElement(pEnt); if (bMult) inFac *= dFactor; else inFac += dFactor; pEnt->transformBy(OdGeMatrix3d::scaling(inFac, ext.center())); } } } } }; static OdStaticRxObject g_OdExScaledArrayCmd; class OdExEraseByClassNameCmd : public OdEdCommand { public: const OdString groupName() const { return OD_T("ODAMFCAPP"); } const OdString globalName() const { return OD_T("ExEraseByClassName"); } void execute(OdEdCommandContext* pCmdCtx) { OdDgCommandContextPtr pDbCmdCtx(pCmdCtx); OdDgDatabasePtr pDb = pDbCmdCtx->database(); OdSmartPtr pIO = pDbCmdCtx->userIO(); OdString className = pIO->getString(OD_T("Enter class name:")); OdRxObjectPtr pClassObj = ::odrxClassDictionary()->getAt(className); OdRxClass *pClass = OdRxClass::cast(pClassObj).get(); if (!pClass) { pIO->putString(OD_T("No class found.")); return; } OdArray pEnts; //OdDbBlockTableRecordPtr pBTR = pDb->getActiveLayoutBTRId().openObject(); //OdDbObjectIteratorPtr pIt = pBTR->newIterator(); OdDgModelPtr pBTR = pDb->getActiveModelId().openObject(); OdDgElementIteratorPtr pIt = pBTR->createGraphicsElementsIterator(); while (!pIt->done()) { OdDgElementPtr pEnt = pIt->item().openObject(); if (pEnt->isKindOf(pClass)) pEnts.push_back(pEnt); pIt->step(); } if (pEnts.isEmpty()) { pIO->putString(OD_T("No objects found.")); return; } for (OdUInt32 nEnt = 0; nEnt < pEnts.size(); nEnt++) { pEnts[nEnt]->upgradeOpen(); pEnts[nEnt]->erase(); } pIO->putString(OdString().format(OD_T("%u objects erased."), pEnts.size())); } }; static OdStaticRxObject g_OdExEraseByClassNameCmd; class OdExCopyEntToBlockCmd : public OdEdCommand { public: const OdString groupName() const { return OD_T("ODAMFCAPP"); } const OdString globalName() const { return OD_T("ExCopyEntToBlock"); } void execute(OdEdCommandContext* pCmdCtx) { OdDgCommandContextPtr pDbCmdCtx(pCmdCtx); OdDgDatabasePtr pDb = pDbCmdCtx->database(); OdSmartPtr pIO = pDbCmdCtx->userIO(); OdGsViewPtr pGsView = pDb->getActiveViewGroupId().openObject(OdDg::kForWrite); OdDgSelectionSetPtr pSSet = pIO->select(pGsView); if (pSSet->numEntities() > 0) { OdString blockName = pIO->getString(OD_T("Enter block name:")); //OdDbBlockTableRecordPtr pBTR = OdDbBlockTable::cast(pDb->getBlockTableId().safeOpenObject())->getAt(blockName).openObject(OdDb::kForWrite); OdDgModelPtr pBTR = OdDgModelTable::cast(pDb->getModelTable()->getAt(blockName).openObject(OdDg::kForWrite)); if (pBTR.isNull()) { pIO->putString(OD_T("Block not found.")); return; } OdDgSelectionSetIteratorPtr pIter = pSSet->newIterator(); for (; !pIter->done(); pIter->next()) { OdDgElementPtr pEnt = pIter->objectId().safeOpenObject(); //pBTR->appendOdDbEntity(OdDbEntity::cast(pEnt->clone())); pBTR->addElement(OdDgElement::cast(pEnt->clone())); } } } }; static OdStaticRxObject g_OdExCopyEntToBlockCmd; class OdExGLES2CompositeMfCmd : public OdEdCommand { protected: bool m_bEnabled; public: OdExGLES2CompositeMfCmd() : m_bEnabled(false) { } const OdString groupName() const { return OD_T("ODAMFCAPP"); } const OdString globalName() const { return OD_T("ExGLES2CompositeMf"); } bool setting() const { return m_bEnabled; } void execute(OdEdCommandContext* pCmdCtx) { OdDgCommandContextPtr pDbCmdCtx(pCmdCtx); OdDgDatabasePtr pDb = pDbCmdCtx->database(); OdSmartPtr pIO = pDbCmdCtx->userIO(); m_bEnabled = (0 == pDbCmdCtx->userIO()->getKeyword(OdString().format(OD_T("Enable GLES2 Composite Metafiles Mode (Cur: %ls)[Yes No]?"), (m_bEnabled) ? OD_T("Yes") : OD_T("No")).c_str(), OD_T("Yes No"), (m_bEnabled) ? 0 : 1)); } }; static OdStaticRxObject g_OdExGLES2CompositeMfCmd; bool odExGLES2CompositeMfSetting() { return g_OdExGLES2CompositeMfCmd.setting(); } class OdExSaveGsStateCmd : public OdEdCommand { public: OdExSaveGsStateCmd() { } const OdString groupName() const { return OD_T("ODAMFCAPP"); } const OdString globalName() const { return OD_T("ExSaveGsState"); } void execute(OdEdCommandContext* pCmdCtx) { OdDgCommandContextPtr pDbCmdCtx(pCmdCtx); OdDgDatabasePtr pDb = pDbCmdCtx->database(); OdSmartPtr pIO = pDbCmdCtx->userIO(); CMDIChildWnd *pChild = ((CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd))->MDIGetActive(); if (pChild) { CView *pView = pChild->GetActiveView(); if (pView && pView->IsKindOf(RUNTIME_CLASS(COdaDgnAppVectorizer))) { COdaDgnAppVectorizer *pVectorizer = static_cast(pView); /* if (!pVectorizer->getDevice()->supportLayoutGsStateSaving()) { pIO->putString(OD_T("Vectorization device doesn't support Gs state saving.")); return; }*/ OdString filePath = pIO->getFilePath(L"Select file to save", OdEd::kGfpForSave | OdEd::kGfpOverwritePrompt, L"Select file to save", L"tgss", L"", "TGSS files (*.tgss)|*.tgss"); if (filePath.isEmpty()) { pIO->putString(OD_T("No file selected.")); return; } OdStreamBufPtr pFile = ::odrxSystemServices()->createFile(filePath, Oda::kFileWrite, Oda::kShareDenyWrite, Oda::kCreateAlways); if (pFile.isNull()) { pIO->putString(OD_T("Failed to create file.")); return; } /*if (!pVectorizer->getDevice()->storeLayoutGsState(pFile)) { pIO->putString(OD_T("Failed to save file.")); return; }*/ pIO->putString(OD_T("File saved.")); } else { pIO->putString(OD_T("Failed to detect Gs device.")); } } else { pIO->putString(OD_T("Failed to detect MDI child window.")); } } }; static OdStaticRxObject g_OdExSaveGsStateCmd; class OdExLoadGsStateCmd : public OdEdCommand { protected: bool m_bEnabled; OdString m_fileName; public: OdExLoadGsStateCmd() : m_bEnabled(false) { } const OdString groupName() const { return OD_T("ODAMFCAPP"); } const OdString globalName() const { return OD_T("ExLoadGsState"); } bool setting() const { return m_bEnabled; } const OdString &fileName() const { return m_fileName; } void execute(OdEdCommandContext* pCmdCtx) { OdDgCommandContextPtr pDbCmdCtx(pCmdCtx); OdDgDatabasePtr pDb = pDbCmdCtx->database(); OdSmartPtr pIO = pDbCmdCtx->userIO(); m_bEnabled = (0 == pDbCmdCtx->userIO()->getKeyword(OdString().format(OD_T("Enable Gs State Loading (Cur: %ls)[Yes No]?"), (m_bEnabled) ? OD_T("Yes") : OD_T("No")).c_str(), OD_T("Yes No"), (m_bEnabled) ? 0 : 1)); if (m_bEnabled) m_fileName = pIO->getFilePath(L"Select file to load", OdEd::kGfpForOpen, L"Select file to load", L"tgss", L"", "TGSS files (*.tgss)|*.tgss"); else m_fileName.empty(); } }; static OdStaticRxObject g_OdExLoadGsStateCmd; const OdString &odExLoadGsStateSetting() { return (g_OdExLoadGsStateCmd.setting()) ? g_OdExLoadGsStateCmd.fileName() : OdString::kEmpty; } void rxInitMaterialsEditorObjects() { odedRegCmds()->addCommand(&g_OdExTeapotCmd); ExTeapot::rxInit(); #ifdef _DEBUG odedRegCmds()->addCommand(&g_OdExDgnSpecTObjCmd); ExDgnSpecTObj::rxInit(); #endif odedRegCmds()->addCommand(&g_OdExScaledArrayCmd); odedRegCmds()->addCommand(&g_OdExEraseByClassNameCmd); odedRegCmds()->addCommand(&g_OdExCopyEntToBlockCmd); odedRegCmds()->addCommand(&g_OdExGLES2CompositeMfCmd); odedRegCmds()->addCommand(&g_OdExSaveGsStateCmd); odedRegCmds()->addCommand(&g_OdExLoadGsStateCmd); } void rxUninitMaterialsEditorObjects() { odedRegCmds()->removeCmd(&g_OdExLoadGsStateCmd); odedRegCmds()->removeCmd(&g_OdExSaveGsStateCmd); odedRegCmds()->removeCmd(&g_OdExGLES2CompositeMfCmd); odedRegCmds()->removeCmd(&g_OdExCopyEntToBlockCmd); odedRegCmds()->removeCmd(&g_OdExEraseByClassNameCmd); odedRegCmds()->removeCmd(&g_OdExScaledArrayCmd); #ifdef _DEBUG ExDgnSpecTObj::rxUninit(); odedRegCmds()->removeCmd(&g_OdExDgnSpecTObjCmd); #endif ExTeapot::rxUninit(); odedRegCmds()->removeCmd(&g_OdExTeapotCmd); } // CCmEntityColorPreview IMPLEMENT_DYNAMIC(CCmEntityColorPreview, CStatic) CCmEntityColorPreview::CCmEntityColorPreview() { } CCmEntityColorPreview::~CCmEntityColorPreview() { } BEGIN_MESSAGE_MAP(CCmEntityColorPreview, CStatic) ON_WM_CREATE() ON_WM_DESTROY() ON_WM_PAINT() END_MESSAGE_MAP() // CCmEntityColorPreview message handlers int CCmEntityColorPreview::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CStatic::OnCreate(lpCreateStruct) == -1) return -1; // . . . return 0; } void CCmEntityColorPreview::OnDestroy() { CStatic::OnDestroy(); } void CCmEntityColorPreview::SetColor(const OdCmEntityColor color) { m_color = color; if (color.isByBlock()) SetWindowText(_T("ByBlock")); else if (color.isByLayer()) SetWindowText(_T("ByLayer")); Invalidate(); } COLORREF CCmEntityColorPreview::GetCref() { COLORREF color = ::GetSysColor(COLOR_BTNFACE); if (m_color.isByACI() || m_color.isByDgnIndex()) color = OdCmEntityColor::lookUpRGB((OdUInt8)m_color.colorIndex()); else if (m_color.isByColor()) color = RGB(m_color.red(), m_color.green(), m_color.blue()); return color; } void CCmEntityColorPreview::OnPaint() { if (m_color.isByBlock() || m_color.isByLayer()) CStatic::OnPaint(); else { CPaintDC dc(this); CRect cliArea; GetClientRect(&cliArea); dc.FillSolidRect(&cliArea, GetCref()); } } ///////////////////////////////////////////////////////////////////////////// // CDbLightsDlg dialog CDbLightsDlg::CDbLightsDlg(OdDgDatabase* pDb, CWnd* pParent /*=NULL*/) : CDialog(CDbLightsDlg::IDD, pParent) , m_pDb(pDb) , m_nItem(0) { //{{AFX_DATA_INIT(CDbLightsDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CDbLightsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDbLightsDlg) DDX_Control(pDX, IDC_LIGHTS_LIST, m_LightsList); DDX_Control(pDX, IDC_SCOLOR, m_Color); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDbLightsDlg, CDialog) //{{AFX_MSG_MAP(CDbLightsDlg) //}}AFX_MSG_MAP ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIGHTS_LIST, &CDbLightsDlg::OnLvnItemchangedLightsList) ON_BN_CLICKED(IDC_CBON, &CDbLightsDlg::OnBnClickedCbon) ON_EN_KILLFOCUS(IDC_EINTENSITY, &CDbLightsDlg::OnEnChangeEintensity) ON_BN_CLICKED(IDC_BCOLOR, &CDbLightsDlg::OnBnClickedBcolor) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDbLightsDlg message handlers BOOL CDbLightsDlg::OnInitDialog() { CDialog::OnInitDialog(); if (m_pDb) { RECT rect; m_LightsList.GetClientRect(&rect); m_LightsList.InsertColumn(0, _T("Type"), LVCFMT_LEFT, (rect.right - rect.left) / 2); m_LightsList.InsertColumn(1, _T("Light Name"), LVCFMT_LEFT, (rect.right - rect.left) / 2); OdDgModelPtr pModel = OdDgModel::cast(m_pDb->getActiveModelId().openObject()); OdDgElementIteratorPtr pModelIt = pModel->createGraphicsElementsIterator(); int nItem = 0; for (; !pModelIt->done(); pModelIt->step()) { CString lightType; OdDgCellHeader3dPtr pCell = OdDgCellHeader3d::cast(pModelIt->item().openObject()); OdRxObjectPtr pObject = pModelIt->item().openObject(); if (pObject->isKindOf(OdDgLightPoint::desc())) { lightType = _T("Point"); OdDgLightPointPtr pPointLight = OdDgLightPoint::cast(pCell); m_LightsList.InsertItem(nItem, lightType); m_LightsList.SetItemText(nItem, 1, pPointLight->getLightName().c_str()); m_LightsList.SetItemData(nItem, (LPARAM)((OdDbStub*)pPointLight->elementId())); nItem++; } else if (pObject->isKindOf(OdDgLightOpenSky::desc())) { lightType = _T("OpenSky"); OdDgLightOpenSkyPtr pOpenSkyLight = OdDgLightOpenSky::cast(pCell); m_LightsList.InsertItem(nItem, lightType); m_LightsList.SetItemText(nItem, 1, pOpenSkyLight->getLightName().c_str()); m_LightsList.SetItemData(nItem, (LPARAM)((OdDbStub*)pOpenSkyLight->elementId())); nItem++; } else if (pObject->isKindOf(OdDgLightArea::desc())) { lightType = _T("Area"); OdDgLightAreaPtr pAreaLight = OdDgLightArea::cast(pCell); m_LightsList.InsertItem(nItem, lightType); m_LightsList.SetItemText(nItem, 1, pAreaLight->getLightName().c_str()); m_LightsList.SetItemData(nItem, (LPARAM)((OdDbStub*)pAreaLight->elementId())); nItem++; } else if (pObject->isKindOf(OdDgLightSpot::desc())) { lightType = _T("Spot"); OdDgLightSpotPtr pSpotLight = OdDgLightSpot::cast(pCell); m_LightsList.InsertItem(nItem, lightType); m_LightsList.SetItemText(nItem, 1, pSpotLight->getLightName().c_str()); m_LightsList.SetItemData(nItem, (LPARAM)((OdDbStub*)pSpotLight->elementId())); nItem++; } else if (pObject->isKindOf(OdDgLightDistant::desc())) { lightType = _T("Distant"); OdDgLightDistantPtr pDistantLight = OdDgLightDistant::cast(pCell); m_LightsList.InsertItem(nItem, lightType); m_LightsList.SetItemText(nItem, 1, pDistantLight->getLightName().c_str()); m_LightsList.SetItemData(nItem, (LPARAM)((OdDbStub*)pDistantLight->elementId())); nItem++; } } } UpdateProperties(-1); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDbLightsDlg::UpdateProperties(int nItem) { if (nItem == -1) { GetDlgItem(IDC_CBON)->EnableWindow(FALSE); GetDlgItem(IDC_EINTENSITY)->EnableWindow(FALSE); GetDlgItem(IDC_BCOLOR)->EnableWindow(FALSE); } else { GetDlgItem(IDC_CBON)->EnableWindow(TRUE); GetDlgItem(IDC_EINTENSITY)->EnableWindow(TRUE); GetDlgItem(IDC_BCOLOR)->EnableWindow(TRUE); OdCmEntityColor toColor; OdDgElementId pLightId; OdDbStub* pLightIdStb = (OdDbStub*)m_LightsList.GetItemData(nItem); if (pLightIdStb) pLightId = (OdDgElementId)(pLightIdStb); OdDgCellHeader3dPtr pCell = OdDgCellHeader3d::cast(pLightId.openObject()); OdRxObjectPtr pObject = pLightId.openObject(); if (pObject->isKindOf(OdDgLightPoint::desc())) { OdDgLightPointPtr pPointLight = OdDgLightPoint::cast(pCell); SetDlgItemText(IDC_SPOSITION, OdString().format(OD_T("{ %.2f; %.2f; %.2f }"), pPointLight->getOrigin().x, pPointLight->getOrigin().y, pPointLight->getOrigin().z)); CheckDlgButton(IDC_CBON, (pPointLight->getOnFlag()) ? BST_CHECKED : BST_UNCHECKED); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("%f"), pPointLight->getIntensity())); double r, g, b; r = pPointLight->getColorRed(); g = pPointLight->getColorGreen(); b = pPointLight->getColorBlue(); m_Color.SetColor(OdCmEntityColor((OdUInt8)(r*255.0), (OdUInt8)(g*255.0), (OdUInt8)(b*255.0))); } else if (pObject->isKindOf(OdDgLightOpenSky::desc())) { OdDgLightOpenSkyPtr pOpenSkyLight = OdDgLightOpenSky::cast(pCell); SetDlgItemText(IDC_SPOSITION, OdString().format(OD_T("{ %.2f; %.2f; %.2f }"), pOpenSkyLight->getOrigin().x, pOpenSkyLight->getOrigin().y, pOpenSkyLight->getOrigin().z)); CheckDlgButton(IDC_CBON, (pOpenSkyLight->getOnFlag()) ? BST_CHECKED : BST_UNCHECKED); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("N/A"))); GetDlgItem(IDC_EINTENSITY)->EnableWindow(FALSE); GetDlgItem(IDC_BCOLOR)->EnableWindow(FALSE); m_Color.SetColor(OdCmEntityColor()); } else if (pObject->isKindOf(OdDgLightArea::desc())) { OdDgLightAreaPtr pAreaLight = OdDgLightArea::cast(pCell); SetDlgItemText(IDC_SPOSITION, OdString().format(OD_T("{ %.2f; %.2f; %.2f }"), pAreaLight->getOrigin().x, pAreaLight->getOrigin().y, pAreaLight->getOrigin().z)); CheckDlgButton(IDC_CBON, (pAreaLight->getOnFlag()) ? BST_CHECKED : BST_UNCHECKED); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("%f"), pAreaLight->getIntensity())); double r, g, b; r = pAreaLight->getColorRed(); g = pAreaLight->getColorGreen(); b = pAreaLight->getColorBlue(); m_Color.SetColor(OdCmEntityColor((OdUInt8)(r*255.0), (OdUInt8)(g*255.0), (OdUInt8)(b*255.0))); } else if (pObject->isKindOf(OdDgLightSpot::desc())) { OdDgLightSpotPtr pSpotLight = OdDgLightSpot::cast(pCell); SetDlgItemText(IDC_SPOSITION, OdString().format(OD_T("{ %.2f; %.2f; %.2f }"), pSpotLight->getOrigin().x, pSpotLight->getOrigin().y, pSpotLight->getOrigin().z)); CheckDlgButton(IDC_CBON, (pSpotLight->getOnFlag()) ? BST_CHECKED : BST_UNCHECKED); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("%f"), pSpotLight->getIntensity())); double r, g, b; r = pSpotLight->getColorRed(); g = pSpotLight->getColorGreen(); b = pSpotLight->getColorBlue(); m_Color.SetColor(OdCmEntityColor((OdUInt8)(r*255.0), (OdUInt8)(g*255.0), (OdUInt8)(b*255.0))); } else if (pObject->isKindOf(OdDgLightDistant::desc())) { OdDgLightDistantPtr pDistantLight = OdDgLightDistant::cast(pCell); SetDlgItemText(IDC_SPOSITION, OdString().format(OD_T("{ %.2f; %.2f; %.2f }"), pDistantLight->getOrigin().x, pDistantLight->getOrigin().y, pDistantLight->getOrigin().z)); CheckDlgButton(IDC_CBON, (pDistantLight->getOnFlag()) ? BST_CHECKED : BST_UNCHECKED); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("%f"), pDistantLight->getIntensity())); double r, g, b; r = pDistantLight->getColorRed(); g = pDistantLight->getColorGreen(); b = pDistantLight->getColorBlue(); m_Color.SetColor(OdCmEntityColor((OdUInt8)(r*255.0), (OdUInt8)(g*255.0), (OdUInt8)(b*255.0))); } } m_nItem = nItem; } void CDbLightsDlg::OnLvnItemchangedLightsList(NMHDR *pNMHDR, LRESULT *pResult) { LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); if ((pNMLV->uChanged & LVIF_STATE) && (pNMLV->uNewState & LVNI_SELECTED)) UpdateProperties(pNMLV->iItem); // TODO: Add your control notification handler code here *pResult = 0; } void CDbLightsDlg::OnBnClickedCbon() { OdDgElementId pLightId = (OdDgElementId)((OdDbStub*)m_LightsList.GetItemData(m_nItem)); OdRxObjectPtr pObject = (pLightId.openObject()); if (pObject->isKindOf(OdDgLightPoint::desc())) { OdDgLightPointPtr pPointLight = OdDgLightPoint::cast(pObject); pPointLight->upgradeOpen(); bool b = IsDlgButtonChecked(IDC_CBON) == BST_CHECKED; pPointLight->setOnFlag(IsDlgButtonChecked(IDC_CBON) == BST_CHECKED); } else if (pObject->isKindOf(OdDgLightOpenSky::desc())) { OdDgLightOpenSkyPtr pOpenSkyLight = OdDgLightOpenSky::cast(pObject); pOpenSkyLight->upgradeOpen(); pOpenSkyLight->setOnFlag(IsDlgButtonChecked(IDC_CBON) == BST_CHECKED); } else if (pObject->isKindOf(OdDgLightArea::desc())) { OdDgLightAreaPtr pAreaLight = OdDgLightArea::cast(pObject); pAreaLight->upgradeOpen(); pAreaLight->setOnFlag(IsDlgButtonChecked(IDC_CBON) == BST_CHECKED); } else if (pObject->isKindOf(OdDgLightSpot::desc())) { OdDgLightSpotPtr pSpotLight = OdDgLightSpot::cast(pObject); pSpotLight->upgradeOpen(); pSpotLight->setOnFlag(IsDlgButtonChecked(IDC_CBON) == BST_CHECKED); } else if (pObject->isKindOf(OdDgLightDistant::desc())) { OdDgLightDistantPtr pDistantLight = OdDgLightDistant::cast(pObject); pDistantLight->upgradeOpen(); pDistantLight->setOnFlag(IsDlgButtonChecked(IDC_CBON) == BST_CHECKED); } } void CDbLightsDlg::OnEnChangeEintensity() { OdDgElementId pLightId; OdDbStub* pLightIdStb = (OdDbStub*)m_LightsList.GetItemData(m_nItem); if (pLightIdStb) pLightId = (OdDgElementId)(pLightIdStb); OdRxObjectPtr pObject = (pLightId.openObject()); CString intensity; GetDlgItemText(IDC_EINTENSITY, intensity); double dStr = odStrToD(intensity.GetBuffer()); if (dStr == 0.0) return; if (pObject->isKindOf(OdDgLightPoint::desc())) { OdDgLightPointPtr pPointLight = OdDgLightPoint::cast(pObject); pPointLight->upgradeOpen(); pPointLight->setIntensity(dStr); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("%f"), pPointLight->getIntensity()).c_str()); } else if (pObject->isKindOf(OdDgLightArea::desc())) { OdDgLightAreaPtr pAreaLight = OdDgLightArea::cast(pObject); pAreaLight->upgradeOpen(); pAreaLight->setIntensity(dStr); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("%f"), pAreaLight->getIntensity()).c_str()); } else if (pObject->isKindOf(OdDgLightSpot::desc())) { OdDgLightSpotPtr pSpotLight = OdDgLightSpot::cast(pObject); pSpotLight->upgradeOpen(); pSpotLight->setIntensity(dStr); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("%f"), pSpotLight->getIntensity()).c_str()); } else if (pObject->isKindOf(OdDgLightDistant::desc())) { OdDgLightDistantPtr pDistantLight = OdDgLightDistant::cast(pObject); pDistantLight->upgradeOpen(); pDistantLight->setIntensity(dStr); SetDlgItemText(IDC_EINTENSITY, OdString().format(OD_T("%f"), pDistantLight->getIntensity()).c_str()); } } void CDbLightsDlg::OnBnClickedBcolor() { CColorPickerDlg dlg; dlg.SetColor(m_Color.GetCref()); if (dlg.DoModal() == IDOK) { COLORREF color = dlg.GetColor(); OdCmEntityColor cmColor(GetRValue(color), GetGValue(color), GetBValue(color)); double r, g, b; r = GetRValue(color); g = GetGValue(color); b = GetBValue(color); OdDgElementId pLightId; OdDbStub* pLightIdStb = (OdDbStub*)m_LightsList.GetItemData(m_nItem); if (pLightIdStb) pLightId = (OdDgElementId)(pLightIdStb); OdRxObjectPtr pObject = (pLightId.openObject()); if (pObject->isKindOf(OdDgLightPoint::desc())) { OdDgLightPointPtr pPointLight = OdDgLightPoint::cast(pObject); pPointLight->upgradeOpen(); pPointLight->setColorRed((double)(r / 255.0)); pPointLight->setColorGreen((double)(g / 255.0)); pPointLight->setColorBlue((double)(b / 255.0)); m_Color.SetColor(OdCmEntityColor((OdUInt8)r, (OdUInt8)g, (OdUInt8)b)); } else if (pObject->isKindOf(OdDgLightArea::desc())) { OdDgLightAreaPtr pAreaLight = OdDgLightArea::cast(pObject); pAreaLight->upgradeOpen(); pAreaLight->setColorRed((double)(r / 255.0)); pAreaLight->setColorGreen((double)(g / 255.0)); pAreaLight->setColorBlue((double)(b / 255.0)); m_Color.SetColor(OdCmEntityColor((OdUInt8)r, (OdUInt8)g, (OdUInt8)b)); } else if (pObject->isKindOf(OdDgLightSpot::desc())) { OdDgLightSpotPtr pSpotLight = OdDgLightSpot::cast(pObject); pSpotLight->upgradeOpen(); pSpotLight->setColorRed((double)(r / 255.0)); pSpotLight->setColorGreen((double)(g / 255.0)); pSpotLight->setColorBlue((double)(b / 255.0)); m_Color.SetColor(OdCmEntityColor((OdUInt8)r, (OdUInt8)g, (OdUInt8)b)); } else if (pObject->isKindOf(OdDgLightDistant::desc())) { OdDgLightDistantPtr pDistantLight = OdDgLightDistant::cast(pObject); pDistantLight->upgradeOpen(); pDistantLight->setColorRed((double)(r / 255.0)); pDistantLight->setColorGreen((double)(g / 255.0)); pDistantLight->setColorBlue((double)(b / 255.0)); m_Color.SetColor(OdCmEntityColor((OdUInt8)r, (OdUInt8)g, (OdUInt8)b)); } } } //CMaterialPreview IMPLEMENT_DYNAMIC(CMaterialPreview, CStatic) CMaterialPreview::CMaterialPreview(OdDgDatabase *pHostDb) : m_pHostDb(pHostDb) , m_hDc(NULL) , m_devName(OdWinOpenGLModuleName) , m_bDiagBkgnd(false) { } CMaterialPreview::~CMaterialPreview() { } BEGIN_MESSAGE_MAP(CMaterialPreview, CStatic) ON_WM_CREATE() ON_WM_DESTROY() ON_WM_PAINT() END_MESSAGE_MAP() // CMaterialPreview message handlers int CMaterialPreview::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CStatic::OnCreate(lpCreateStruct) == -1) return -1; return 0; } void CMaterialPreview::OnDestroy() { if (m_hDc) ReleaseDC(m_hDc); CStatic::OnDestroy(); } OdString CMaterialPreview::findFile(const OdString& file, OdDbBaseDatabase* pDb, OdDbBaseHostAppServices::FindFileHint hint) { return theApp.findFile(file, m_pHostDb, hint); } void CMaterialPreview::recountVeiws(std::vector &pViews, OdDgDatabasePtr pDb) { pViews.resize(0); OdDgViewGroupPtr pViewGroup = pDb->getActiveViewGroupId().openObject(); if (pViewGroup.isNull()) { return; } OdDgElementIteratorPtr pIt = pViewGroup->createIterator(); for (; !pIt->done(); pIt->step()) { OdDgViewPtr pView = OdDgView::cast(pIt->item().openObject()); if (pView.get() && pView->getVisibleFlag()) { pViews.push_back(pIt->item()); } } } void CMaterialPreview::PreparePreviewDatabase( OdDgHostAppServices* pAppServices ) { if( pAppServices ) { m_pDb = pAppServices->createDatabase(); } else { m_pDb = createDatabase(); } { // Create preview material OdDgMaterialTableRecordPtr pMtl = OdDgMaterialTableRecord::createObject(); pMtl->setName(OD_T("PreviewMaterial")); m_pDb->getMaterialTable(OdDg::kForWrite)->add(pMtl); } { // Create preview entity OdSmartPtr pTeapot = ExTeapot::createObject(); pTeapot->setScale(OdGeScale3d(1.0)); pTeapot->setPosition(OdGePoint3d::kOrigin - OdGeVector3d::kZAxis * 0.5); pTeapot->setRotate(OdGeVector3d(-OdaPI / 4, 0.0, -OdaPI / 4)); OdDgModelPtr pActiveModel = OdDgModel::cast(m_pDb->getActiveModelId().openObject(OdDg::kForWrite)); pActiveModel->addElement(pTeapot); } { // Prepare view settings std::vector pViews; recountVeiws(pViews, m_pDb); if (pViews.size()) { OdDgViewPtr pView = OdDgView::cast(pViews[0].openObject()); OdAbstractViewPEPtr pSet(pView); pSet->setRenderMode(pView, OdDb::kGouraudShaded); pSet->setView(pView, OdGePoint3d::kOrigin, OdGeVector3d::kYAxis * 5.0, OdGeVector3d::kZAxis, 2.5, 2.5, false); } } } void CMaterialPreview::PreparePreviewDevice() { m_pDevice.release(); CRect rc; GetClientRect(&rc); try { OdGsModulePtr pGs = ::odrxDynamicLinker()->loadModule(m_devName.GetBuffer(), false); OdGsDevicePtr pDevice = pGs->createDevice(); OdRxDictionaryPtr pProperties = pDevice->properties(); if (pProperties.get()) { if (pProperties->has(OD_T("WindowHWND"))) // Check if property is supported pProperties->putAt(OD_T("WindowHWND"), OdRxVariantValue((OdIntPtr)GetSafeHwnd())); // hWnd necessary for DirectX device if (!m_hDc) m_hDc = GetDC(); if (pProperties->has(OD_T("WindowHDC"))) // Check if property is supported pProperties->putAt(OD_T("WindowHDC"), OdRxVariantValue((OdIntPtr)m_hDc->GetSafeHdc())); // hWindowDC necessary for Bitmap device } if (m_pCtx.isNull()) { m_pCtx = OdGiContextForDgDatabase::createObject(); m_pCtx->enableGsModel(true); m_pCtx->setPaletteBackground(ODRGB(0, 0, 0)); m_pCtx->setDatabase(m_pDb); } std::vector pViews; recountVeiws(pViews, m_pDb); if (pViews.size()) { OdDgViewPtr pView = OdDgView::cast(pViews[0].openObject()); OdDgElementId pModelId = m_pDb->getActiveModelId(); OdDgModelPtr pModel = OdDgModel::cast(pModelId.openObject(OdDg::kForWrite)); pModel->fitToView(); pView->upgradeOpen(); m_pCtx->setView(pView); m_pDevice = OdGsDeviceForDgModel::setupModelView(pModelId, pView->elementId(), pDevice, m_pCtx); m_pDevice->setLogicalPalette(::odcmAcadDarkPalette(), 256); m_pDevice->setBackgroundColor(ODRGB(0, 0, 0)); OdGsDCRect gsRect(rc.left, rc.right, rc.bottom, rc.top); m_pDevice->onSize(gsRect); Invalidate(); } } catch (const OdError& /*e*/) { m_pDevice.release(); MessageBox(_T("Requested device couldn't be created."), _T("Graphic System Initialization Error"), MB_ICONSTOP); } } void CMaterialPreview::SetMaterial(const OdDgElementId &mtlId, CString sMaterialString, OdDgDatabasePtr pDb) { if (m_pDb.isNull()) { OdDgHostAppServices* pAppServices; if( !pDb.isNull() ) { pAppServices = pDb->appServices(); } PreparePreviewDatabase( pAppServices ); } OdDgMaterialTableRecordPtr pMtl = mtlId.openObject()->clone(); pMtl->setName(OD_T("PreviewMaterial")); OdDgMaterialTableRecordPtr pMtlTo = m_pDb->getMaterialTable()->getAt(OD_T("PreviewMaterial"), OdDg::kForWrite).openObject(OdDg::kForWrite); pMtlTo->handOverTo(OdDgElement::cast(pMtl)); ExTeapot* pTeapot; OdDgElementIteratorPtr it = OdDgModel::cast(m_pDb->getActiveModelId().openObject(OdDg::kForWrite))->createGraphicsElementsIterator(); //Removing previously installed linkages for (; !it->done(); it->step()) { pTeapot = ExTeapot::cast(OdDgElement::cast(it->item().openObject(OdDg::kForWrite))); if (pTeapot) break; } if( pTeapot ) pTeapot->setMaterial( pMtl->elementId() ); if (m_pDevice.isNull()) PreparePreviewDevice(); UpdatePreview(); } OdDgElementId CMaterialPreview::GetMaterial() { return (m_pDb->getMaterialTable()->getAt(OD_T("PreviewMaterial"))); } void CMaterialPreview::ResetDevice(const CString &devName, bool bMaterial) { if (m_pDevice.isNull() || devName != m_devName) { m_devName = devName; if (bMaterial) PreparePreviewDevice(); } } void CMaterialPreview::UpdatePreview() { if (!m_pDevice.isNull()) { OdGsDeviceForDgModel::cast(m_pDevice)->gsModel()->invalidate(OdGsModel::kInvalidateAll); m_pDevice->invalidate(); Invalidate(); } } void CMaterialPreview::OnPaint() { CPaintDC dc(this); if (m_pDevice.isNull()) { CRect cliArea; GetClientRect(&cliArea); dc.FillSolidRect(&cliArea, ::GetSysColor(COLOR_BTNFACE)); } else { m_pDevice->update(); } } ///////////////////////////////////////////////////////////////////////////// // CDbMaterialsDlg dialog CDbMaterialsDlg::CDbMaterialsDlg(OdDgDatabasePtr pDb, CWnd* pParent /*=NULL*/) : CDialog(CDbMaterialsDlg::IDD, pParent) , m_Material(pDb) , m_pDb(pDb) , m_bChanged(false) { //{{AFX_DATA_INIT(CDbMaterialsDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CDbMaterialsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDbMaterialsDlg) DDX_Control(pDX, IDC_LBMATERIALS, m_MaterialsList); DDX_Control(pDX, IDC_SPREVIEW, m_Material); DDX_Control(pDX, IDC_SDIFFUSE, m_Diffuse); DDX_Control(pDX, IDC_SSPECULAR, m_Specular); DDX_Control(pDX, IDC_CBDEVICE, m_Device); DDX_Control(pDX, IDC_SGLOSS, m_Gloss); DDX_Control(pDX, IDC_SOPACITY, m_Opacity); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDbMaterialsDlg, CDialog) //{{AFX_MSG_MAP(CDbMaterialsDlg) //}}AFX_MSG_MAP ON_LBN_SELCHANGE(IDC_LBMATERIALS, &CDbMaterialsDlg::OnLbnSelchangeLbmaterials) ON_CBN_SELCHANGE(IDC_CBDEVICE, &CDbMaterialsDlg::OnCbnSelchangeCbdevice) ON_BN_CLICKED(IDC_BDIFFUSE, &CDbMaterialsDlg::OnBnClickedBdiffuse) ON_BN_CLICKED(IDC_BSPECULAR, &CDbMaterialsDlg::OnBnClickedBspecular) ON_BN_CLICKED(IDC_CHECK1, &CDbMaterialsDlg::OnBnClickedCheck2) ON_WM_HSCROLL() ON_BN_CLICKED(IDOK, &CDbMaterialsDlg::OnBnClickedOk) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDbMaterialsDlg message handlers BOOL CDbMaterialsDlg::OnInitDialog() { CDialog::OnInitDialog(); if (m_pDb) { OdDgMaterialTablePtr pMaterialTable = OdDgMaterialTable::cast(m_pDb->getMaterialTable()); OdDgElementIteratorPtr pIt = pMaterialTable->createIterator(); while (!pIt->done()) { m_MaterialsList.AddString(OdDgMaterialTableRecord::cast(pIt->item().openObject())->getName()); pIt->step(); } } m_Device.AddString(OdWinOpenGLModuleName); m_Device.AddString(OdWinDirectXModuleName); m_Device.AddString(OdWinGLES2ModuleName); m_Device.AddString(_T("WinOpenRL.txv")); m_Device.SelectString(0, OdWinOpenGLModuleName); UpdateMaterial(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDbMaterialsDlg::CheckChanges() { if (m_bChanged) { if (MessageBox(_T("Material was changed.\nWould you like to apply changes in database?"), _T("Material Modified"), MB_ICONQUESTION | MB_YESNO) == IDYES) { OdDgMaterialTableRecordPtr pMtlFrom = m_Material.GetMaterial().openObject(OdDg::kForWrite)->clone(); CString mtlName; m_MaterialsList.GetText(m_nItem, mtlName); OdDgMaterialTableRecordPtr pMtlTo = OdDgMaterialTableRecord::cast(m_pDb->getMaterialTable(OdDg::kForWrite)->getAt(mtlName.GetBuffer(), OdDg::kForWrite).openObject(OdDg::kForWrite)); pMtlFrom->setName(pMtlTo->getName()); pMtlTo->handOverTo(pMtlFrom); } m_bChanged = false; } } void CDbMaterialsDlg::UpdateMaterial() { int nItem = m_MaterialsList.GetCurSel(); if (nItem == -1) { GetDlgItem(IDC_BDIFFUSE)->EnableWindow(FALSE); GetDlgItem(IDC_BSPECULAR)->EnableWindow(FALSE); GetDlgItem(IDC_CHECK1)->EnableWindow(FALSE); GetDlgItem(IDC_SGLOSS)->EnableWindow(FALSE); GetDlgItem(IDC_SOPACITY)->EnableWindow(FALSE); } else { CheckChanges(); m_nItem = nItem; GetDlgItem(IDC_BDIFFUSE)->EnableWindow(TRUE); GetDlgItem(IDC_BSPECULAR)->EnableWindow(TRUE); GetDlgItem(IDC_CHECK1)->EnableWindow(TRUE); GetDlgItem(IDC_SGLOSS)->EnableWindow(TRUE); GetDlgItem(IDC_SOPACITY)->EnableWindow(TRUE); // init preview CString mtlName; m_MaterialsList.GetText(nItem, mtlName); OdDgMaterialTablePtr pMaterialTable = m_pDb->getMaterialTable(); OdDgMaterialTableRecordPtr pMtl = OdDgMaterialTableRecord::cast(pMaterialTable->getAt(mtlName.GetBuffer()).openObject()); m_Material.SetMaterial(pMtl->elementId(), mtlName, m_pDb); // init properties { // ambient color OdGiMaterialColor ambColor; pMtl->getAmbient(ambColor); } { // self-illumination bool bIlluminationFlag = pMtl->getGlobalIlluminationFlag(); CheckDlgButton(IDC_CHECK1, (bIlluminationFlag) ? BST_CHECKED : BST_UNCHECKED); } { // diffuse color OdGiMaterialColor difColor; OdDgMaterialMap dgDifMap; OdGiMaterialMap giDifMap; pMtl->getDiffuse(difColor, dgDifMap); dgDifMap.getGiMaterialMap(giDifMap); m_Diffuse.SetColor(difColor.color()); if ((giDifMap.source() == OdGiMaterialMap::kFile) && !giDifMap.sourceFileName().isEmpty()) SetDlgItemText(IDC_SDIFFUSEMAP, giDifMap.sourceFileName().c_str()); else if ((giDifMap.source() == OdGiMaterialMap::kProcedural) && !giDifMap.texture().isNull()) SetDlgItemText(IDC_SDIFFUSEMAP, giDifMap.texture()->isA()->name().c_str()); else SetDlgItemText(IDC_SDIFFUSEMAP, _T("None")); } { // specular color OdGiMaterialColor specColor; OdGiMaterialMap specMap; double glossFac; pMtl->getSpecular(specColor, glossFac); m_Specular.SetColor(specColor.color()); m_Gloss.SetRange(0, 100); m_Gloss.SetPos((int)(glossFac * 100)); } { // opacity double opacityPerc; opacityPerc = pMtl->getOpacity(); m_Opacity.SetRange(0, 100); m_Opacity.SetPos((int)(opacityPerc * 100)); } { // name SetDlgItemText(IDC_SNAME, pMtl->getName().c_str()); } } } void CDbMaterialsDlg::OnLbnSelchangeLbmaterials() { UpdateMaterial(); } void CDbMaterialsDlg::OnCbnSelchangeCbdevice() { CString nDevName; m_Device.GetLBText(m_Device.GetCurSel(), nDevName); m_Material.ResetDevice(nDevName, m_MaterialsList.GetCurSel() != -1); } void CDbMaterialsDlg::OnBnClickedBdiffuse() { CColorPickerDlg dlg; dlg.SetColor(m_Diffuse.GetCref()); if (dlg.DoModal() == IDOK) { COLORREF color = dlg.GetColor(); OdCmEntityColor cmColor(GetRValue(color), GetGValue(color), GetBValue(color)); m_Diffuse.SetColor(cmColor); OdDgMaterialTableRecordPtr pMtl = m_Material.GetMaterial().openObject(OdDg::kForWrite); OdGiMaterialColor difColor; OdDgMaterialMap dgDifMap; pMtl->getDiffuse(difColor, dgDifMap); difColor.setColor(cmColor); difColor.setMethod(OdGiMaterialColor::kOverride); pMtl->setDiffuse(difColor, dgDifMap); OdGiMaterialColor ambColor; m_Material.UpdatePreview(); m_bChanged = true; } } void CDbMaterialsDlg::OnBnClickedBspecular() { CColorPickerDlg dlg; dlg.SetColor(m_Specular.GetCref()); if (dlg.DoModal() == IDOK) { COLORREF color = dlg.GetColor(); OdCmEntityColor cmColor(GetRValue(color), GetGValue(color), GetBValue(color)); m_Specular.SetColor(cmColor); OdDgMaterialTableRecordPtr pMtl = m_Material.GetMaterial().openObject(OdDg::kForWrite); OdGiMaterialColor specColor; double glossFac; pMtl->getSpecular(specColor, glossFac); specColor.setColor(cmColor); specColor.setMethod(OdGiMaterialColor::kOverride); pMtl->setSpecular(specColor, pMtl->kCustom, glossFac, pMtl->kGlossFactorCustom); OdGiMaterialColor specColor1; double glossFac1; pMtl->getSpecular(specColor1, glossFac1); m_Material.UpdatePreview(); m_bChanged = true; } } void CDbMaterialsDlg::OnBnClickedCheck2() { OdDgMaterialTableRecordPtr pMtl = m_Material.GetMaterial().openObject(OdDg::kForWrite); pMtl->setGlobalIlluminationFlag(IsDlgButtonChecked(IDC_CHECK1) == BST_CHECKED); m_Material.UpdatePreview(); m_bChanged = true; } void CDbMaterialsDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { int minpos, maxpos; CSliderCtrl *pSlider = reinterpret_cast(pScrollBar); pSlider->GetRange(minpos, maxpos); int curpos = pSlider->GetPos(); switch (nSBCode) { case SB_LEFT: curpos = minpos; break; case SB_RIGHT: curpos = maxpos; break; case SB_ENDSCROLL: break; case SB_LINELEFT: if (curpos > minpos) curpos--; break; case SB_LINERIGHT: if (curpos < maxpos) curpos++; break; case SB_PAGELEFT: { if (curpos > minpos) curpos = odmax(minpos, curpos - 10); } break; case SB_PAGERIGHT: { SCROLLINFO info; pScrollBar->GetScrollInfo(&info, SIF_ALL); if (curpos < maxpos) curpos = odmin(maxpos, curpos + 10); } break; case SB_THUMBPOSITION: curpos = nPos; break; case SB_THUMBTRACK: curpos = nPos; break; } if (nSBCode != SB_ENDSCROLL) { OdDgMaterialTableRecordPtr pMtl = m_Material.GetMaterial().openObject(OdDg::kForWrite); double newVal = (double)curpos / maxpos; if (pScrollBar->m_hWnd == GetDlgItem(IDC_SGLOSS)->m_hWnd) { OdGiMaterialColor specColor; double glossFac; pMtl->getSpecular(specColor, glossFac); glossFac = newVal; pMtl->setSpecular(specColor, pMtl->kCustom, glossFac, pMtl->kGlossFactorCustom); } else if (pScrollBar->m_hWnd == GetDlgItem(IDC_SOPACITY)->m_hWnd) { OdGiMaterialMap opacityMap; double opacityPerc; opacityPerc = pMtl->getOpacity(); opacityPerc = newVal; pMtl->setOpacity(opacityPerc); } m_Material.UpdatePreview(); m_bChanged = true; } CDialog::OnHScroll(nSBCode, nPos, pScrollBar); } void CDbMaterialsDlg::OnBnClickedOk() { CheckChanges(); CDialog::OnOK(); }