00001 /* 00002 * Copyright (c) 2006 00003 * Side Effects Software Inc. All rights reserved. 00004 * 00005 * Redistribution and use of Houdini Development Kit samples in source and 00006 * binary forms, with or without modification, are permitted provided that the 00007 * following conditions are met: 00008 * 1. Redistributions of source code must retain the above copyright notice, 00009 * this list of conditions and the following disclaimer. 00010 * 2. The name of Side Effects Software may not be used to endorse or 00011 * promote products derived from this software without specific prior 00012 * written permission. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS 00015 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00016 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00017 * NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, 00018 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00019 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00020 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00021 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00022 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00023 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 * 00025 *---------------------------------------------------------------------------- 00026 * Defines the atomic objects defined in euclidean geometry, 00027 * the circle, the line, and the point 00028 */ 00029 00030 #include "EUC_Object.h" 00031 00032 using namespace HDK_Sample; 00033 00034 // 00035 // EUC_Object 00036 // 00037 EUC_Object::EUC_Object() 00038 { 00039 myCd = 1; 00040 myVisible = true; 00041 } 00042 00043 EUC_Object::~EUC_Object() 00044 { 00045 } 00046 00047 void 00048 EUC_Object::setLook(bool visible, const UT_Vector3 &cd) 00049 { 00050 myVisible = visible; 00051 myCd = cd; 00052 } 00053 00054 // 00055 // EUC_Point 00056 // 00057 EUC_Point::EUC_Point() : EUC_Object() 00058 { 00059 myPos = 0; 00060 } 00061 00062 EUC_Point::EUC_Point(const UT_Vector2 &pos) : EUC_Object() 00063 { 00064 myPos = pos; 00065 } 00066 00067 EUC_Point::~EUC_Point() 00068 { 00069 } 00070 00071 // 00072 // EUC_Line 00073 // 00074 EUC_Line::EUC_Line() : EUC_Object() 00075 { 00076 myPts[0] = 0; 00077 myPts[1] = 0; 00078 } 00079 00080 EUC_Line::~EUC_Line() 00081 { 00082 } 00083 00084 // 00085 // EUC_Circle 00086 // 00087 EUC_Circle::EUC_Circle() : EUC_Line() 00088 { 00089 } 00090 00091 EUC_Circle::~EUC_Circle() 00092 { 00093 } 00094 00095 float 00096 EUC_Circle::getRadius() const 00097 { 00098 UT_Vector2 diff; 00099 00100 diff = myPts[0] - myPts[1]; 00101 return diff.length(); 00102 }
1.5.9