2 * Project Info: http://jcae.sourceforge.net
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18 * (C) Copyright 2005, by EADS CRC
24 %{#include "GeomLProp_SLProps.hxx"%}
26 %typemap(javacode) GeomLProp_SLProps
29 * @deprecated Typo mistake in the previous version
31 public void setParameter(double u, double v)
36 public double[] normal()
38 double[] toReturn=new double[3];
43 /**Return the normal on the uv nodes.<br>
44 *Invalid ones are set to zero.
46 public double[] normalArray(double[] uvNodes)
49 throw new NullPointerException();
51 if(uvNodes.length%2!=0)
52 throw new IllegalArgumentException("uvNodes array length must be peer");
54 int numNodes=uvNodes.length/2;
55 double[] toReturn=new double[numNodes*3];
56 normalArray(uvNodes,toReturn,numNodes);
61 public double[] curvatureDirections()
63 double[] toReturn=new double[6];
64 if(isCurvatureDefined())
66 double[] max=new double[3];
67 double[] min=new double[3];
68 curvatureDirection(max, min);
69 System.arraycopy(max, 0, toReturn, 0, 3);
70 System.arraycopy(min, 0, toReturn, 3, 3);
76 class GeomLProp_SLProps
78 %rename(setParameters) SetParameters;
85 %rename(isTangentUDefined) IsTangentUDefined;
86 %rename(tangentU) TangentU;
87 %rename(isTangentVDefined) IsTangentVDefined;
88 %rename(tangentV) TangentV;
89 %rename(isNormalDefined) IsNormalDefined;
90 %rename(isCurvatureDefined) IsCurvatureDefined;
91 %rename(isUmbilic) IsUmbilic;
92 %rename(meanCurvature) MeanCurvature;
93 %rename(gaussianCurvature) GaussianCurvature;
94 %rename(setSurface) SetSurface;
97 %javamethodmodifiers GeomLProp_SLProps(const Standard_Integer, const Standard_Real) "
99 * The current point and the derivatives are computed at the same time,
100 * which allows an optimization of the computation time.
101 * @param degree The maximum number of derivations to be done (0, 1, or 2).
102 * For example, to compute only the tangent, N should be equal to 1.
103 * @param resolution The linear tolerance (it is used to test if a vector is null).
107 %javamethodmodifiers normalArray(double*, double*, int) "private";
109 GeomLProp_SLProps(const Standard_Integer degree, const Standard_Real resolution);
110 void SetParameters(const Standard_Real u, const Standard_Real v) ;
111 const gp_Pnt& Value() const;
112 const gp_Vec& D1U() ;
113 const gp_Vec& D1V() ;
114 const gp_Vec& D2U() ;
115 const gp_Vec& D2V() ;
116 const gp_Vec& DUV() ;
117 Standard_Boolean IsTangentUDefined() ;
118 void TangentU(gp_Dir& D) ;
119 Standard_Boolean IsTangentVDefined() ;
120 void TangentV(gp_Dir& D) ;
121 Standard_Boolean IsNormalDefined() ;
122 Standard_Boolean IsCurvatureDefined() ;
123 Standard_Boolean IsUmbilic() ;
124 Standard_Real MeanCurvature() ;
125 Standard_Real GaussianCurvature() ;
126 void SetSurface(const Handle_Geom_Surface & S) ;
129 %extend GeomLProp_SLProps
131 void normal(double normal[3])
133 if(!self->IsNormalDefined())
141 const gp_Dir & d=self->Normal();
148 void normalArray(double* uvNodes,double* normalArray,int numNodes)
150 for(int i=0;i<numNodes;i++)
152 self->SetParameters(uvNodes[2*i],uvNodes[2*i+1]);
154 if(!self->IsNormalDefined())
157 normalArray[3*i+1]=0;
158 normalArray[3*i+2]=0;
162 const gp_Dir & d=self->Normal();
164 normalArray[3*i]=d.X();
165 normalArray[3*i+1]=d.Y();
166 normalArray[3*i+2]=d.Z();
171 Standard_Real minCurvature()
173 if (!self->IsCurvatureDefined())
176 return self->MinCurvature ();
179 Standard_Real maxCurvature()
181 if (!self->IsCurvatureDefined())
184 return self->MaxCurvature ();
187 void curvatureDirection(double jmax[3], double jmin[3])
190 self->CurvatureDirections(max, min);