|
||||
File indexing completed on 2025-01-18 10:03:46
0001 // Created on: 1992-02-17 0002 // Created by: Jean Claude VAUTHIER 0003 // Copyright (c) 1992-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _GProp_PrincipalProps_HeaderFile 0018 #define _GProp_PrincipalProps_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <gp_Vec.hxx> 0025 #include <gp_Pnt.hxx> 0026 #include <GProp_GProps.hxx> 0027 #include <Standard_Boolean.hxx> 0028 0029 0030 0031 //! A framework to present the principal properties of 0032 //! inertia of a system of which global properties are 0033 //! computed by a GProp_GProps object. 0034 //! There is always a set of axes for which the 0035 //! products of inertia of a geometric system are equal 0036 //! to 0; i.e. the matrix of inertia of the system is 0037 //! diagonal. These axes are the principal axes of 0038 //! inertia. Their origin is coincident with the center of 0039 //! mass of the system. The associated moments are 0040 //! called the principal moments of inertia. 0041 //! This sort of presentation object is created, filled and 0042 //! returned by the function PrincipalProperties for 0043 //! any GProp_GProps object, and can be queried to access the result. 0044 //! Note: The system whose principal properties of 0045 //! inertia are returned by this framework is referred to 0046 //! as the current system. The current system, 0047 //! however, is retained neither by this presentation 0048 //! framework nor by the GProp_GProps object which activates it. 0049 class GProp_PrincipalProps 0050 { 0051 public: 0052 0053 DEFINE_STANDARD_ALLOC 0054 0055 0056 //! creates an undefined PrincipalProps. 0057 Standard_EXPORT GProp_PrincipalProps(); 0058 0059 0060 //! returns true if the geometric system has an axis of symmetry. 0061 //! For comparing moments relative tolerance 1.e-10 is used. 0062 //! Usually it is enough for objects, restricted by faces with 0063 //! analitycal geometry. 0064 Standard_EXPORT Standard_Boolean HasSymmetryAxis() const; 0065 0066 0067 //! returns true if the geometric system has an axis of symmetry. 0068 //! aTol is relative tolerance for checking equality of moments 0069 //! If aTol == 0, relative tolerance is ~ 1.e-16 (Epsilon(I)) 0070 Standard_EXPORT Standard_Boolean HasSymmetryAxis (const Standard_Real aTol) const; 0071 0072 0073 //! returns true if the geometric system has a point of symmetry. 0074 //! For comparing moments relative tolerance 1.e-10 is used. 0075 //! Usually it is enough for objects, restricted by faces with 0076 //! analitycal geometry. 0077 Standard_EXPORT Standard_Boolean HasSymmetryPoint() const; 0078 0079 0080 //! returns true if the geometric system has a point of symmetry. 0081 //! aTol is relative tolerance for checking equality of moments 0082 //! If aTol == 0, relative tolerance is ~ 1.e-16 (Epsilon(I)) 0083 Standard_EXPORT Standard_Boolean HasSymmetryPoint (const Standard_Real aTol) const; 0084 0085 //! Ixx, Iyy and Izz return the principal moments of inertia 0086 //! in the current system. 0087 //! Notes : 0088 //! - If the current system has an axis of symmetry, two 0089 //! of the three values Ixx, Iyy and Izz are equal. They 0090 //! indicate which eigen vectors define an infinity of 0091 //! axes of principal inertia. 0092 //! - If the current system has a center of symmetry, Ixx, 0093 //! Iyy and Izz are equal. 0094 Standard_EXPORT void Moments (Standard_Real& Ixx, Standard_Real& Iyy, Standard_Real& Izz) const; 0095 0096 //! returns the first axis of inertia. 0097 //! 0098 //! if the system has a point of symmetry there is an infinity of 0099 //! solutions. It is not possible to defines the three axis of 0100 //! inertia. 0101 Standard_EXPORT const gp_Vec& FirstAxisOfInertia() const; 0102 0103 //! returns the second axis of inertia. 0104 //! 0105 //! if the system has a point of symmetry or an axis of symmetry the 0106 //! second and the third axis of symmetry are undefined. 0107 Standard_EXPORT const gp_Vec& SecondAxisOfInertia() const; 0108 0109 //! returns the third axis of inertia. 0110 //! This and the above functions return the first, second or third eigen vector of the 0111 //! matrix of inertia of the current system. 0112 //! The first, second and third principal axis of inertia 0113 //! pass through the center of mass of the current 0114 //! system. They are respectively parallel to these three eigen vectors. 0115 //! Note that: 0116 //! - If the current system has an axis of symmetry, any 0117 //! axis is an axis of principal inertia if it passes 0118 //! through the center of mass of the system, and runs 0119 //! parallel to a linear combination of the two eigen 0120 //! vectors of the matrix of inertia, corresponding to the 0121 //! two eigen values which are equal. If the current 0122 //! system has a center of symmetry, any axis passing 0123 //! through the center of mass of the system is an axis 0124 //! of principal inertia. Use the functions 0125 //! HasSymmetryAxis and HasSymmetryPoint to 0126 //! check these particular cases, where the returned 0127 //! eigen vectors define an infinity of principal axis of inertia. 0128 //! - The Moments function can be used to know which 0129 //! of the three eigen vectors corresponds to the two 0130 //! eigen values which are equal. 0131 //! 0132 //! if the system has a point of symmetry or an axis of symmetry the 0133 //! second and the third axis of symmetry are undefined. 0134 Standard_EXPORT const gp_Vec& ThirdAxisOfInertia() const; 0135 0136 //! Returns the principal radii of gyration Rxx, Ryy 0137 //! and Rzz are the radii of gyration of the current 0138 //! system about its three principal axes of inertia. 0139 //! Note that: 0140 //! - If the current system has an axis of symmetry, 0141 //! two of the three values Rxx, Ryy and Rzz are equal. 0142 //! - If the current system has a center of symmetry, 0143 //! Rxx, Ryy and Rzz are equal. 0144 Standard_EXPORT void RadiusOfGyration (Standard_Real& Rxx, Standard_Real& Ryy, Standard_Real& Rzz) const; 0145 0146 0147 friend 0148 //! Computes the principal properties of inertia of the current system. 0149 //! There is always a set of axes for which the products 0150 //! of inertia of a geometric system are equal to 0; i.e. the 0151 //! matrix of inertia of the system is diagonal. These axes 0152 //! are the principal axes of inertia. Their origin is 0153 //! coincident with the center of mass of the system. The 0154 //! associated moments are called the principal moments of inertia. 0155 //! This function computes the eigen values and the 0156 //! eigen vectors of the matrix of inertia of the system. 0157 //! Results are stored by using a presentation framework 0158 //! of principal properties of inertia 0159 //! (GProp_PrincipalProps object) which may be 0160 //! queried to access the value sought. 0161 Standard_EXPORT GProp_PrincipalProps GProp_GProps::PrincipalProperties() const; 0162 0163 0164 protected: 0165 0166 0167 0168 0169 0170 private: 0171 0172 0173 Standard_EXPORT GProp_PrincipalProps(const Standard_Real Ixx, const Standard_Real Iyy, const Standard_Real Izz, const Standard_Real Rxx, const Standard_Real Ryy, const Standard_Real Rzz, const gp_Vec& Vxx, const gp_Vec& Vyy, const gp_Vec& Vzz, const gp_Pnt& G); 0174 0175 0176 Standard_Real i1; 0177 Standard_Real i2; 0178 Standard_Real i3; 0179 Standard_Real r1; 0180 Standard_Real r2; 0181 Standard_Real r3; 0182 gp_Vec v1; 0183 gp_Vec v2; 0184 gp_Vec v3; 0185 gp_Pnt g; 0186 0187 0188 }; 0189 0190 0191 0192 0193 0194 0195 0196 #endif // _GProp_PrincipalProps_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |