├── IAppletGL.html ├── gui ├── IPanelAdapter.java ├── package-info.java ├── GL2.java ├── IGraphics2D.java ├── ITextureGraphicGL.java ├── IGraphicsGL.java ├── IMouseWheelEvent.java ├── ITextureGraphicGL1.java ├── IComponent.java ├── IGraphicsJ2D.java ├── IKeyEvent.java └── IBrepGraphicGL.java ├── IParticleFactory.java ├── p ├── package-info.java ├── PIApplet.java ├── PIInput.java └── PIConfig.java ├── ITensionFactory.java ├── io ├── package-info.java ├── IInputWrapper.java └── IByteListOutputStream.java ├── IRandom.java ├── IScalar.java ├── IParticleOnCurveFactory.java ├── IMatrixOp.java ├── IVal.java ├── ICurveOp.java ├── IMatrix2Op.java ├── IMatrix3Op.java ├── IMatrix4Op.java ├── IVec2Op.java ├── IVecOp.java ├── IVolumeOp.java ├── IParameter.java ├── ISurfaceOp.java ├── IVec4Op.java ├── IServerI.java ├── IBoolOp.java ├── IDecay.java ├── IIntegerOp.java ├── IIn.java ├── IMaterial.java ├── IBrepXComparator.java ├── IBrepYComparator.java ├── IBrepZComparator.java ├── README.txt ├── ICurveXComparator.java ├── ICurveYComparator.java ├── ICurveZComparator.java ├── IDoubleOp.java ├── ISurfaceXComparator.java ├── ISurfaceYComparator.java ├── ISurfaceZComparator.java ├── ISwitchE.java ├── ISwitchR.java ├── ISwitchI.java ├── INoDecay.java ├── IComparator.java ├── IEntityParameter.java ├── IFunction.java ├── IScalarFieldI.java ├── Ie.java ├── Ir.java ├── IGraphicI.java ├── IConstantMap.java ├── I2DFieldI.java ├── I3DFieldI.java ├── IGeometryZComparator.java ├── IGeometryXComparator.java ├── IGeometryYComparator.java ├── IGaussDecay.java ├── IReferenceParameter.java ├── package-info.java ├── ILinearDecay.java ├── IXComparator.java ├── IYComparator.java ├── IZComparator.java ├── IArithmeticVal.java ├── ITrajectoryI.java ├── IStraightenerI.java ├── IFoldable.java ├── ILinkedVec2Agent.java ├── IParticleOnMeshGeo.java ├── ISubMap.java ├── IValueComparator.java ├── IUFlipMap.java ├── IVFlipMap.java ├── IInvertMap.java ├── ILinkedVecAgent.java ├── IDirectionalComparator.java ├── IMatrix2I.java ├── IMultiplyMap.java ├── IBasicMaterial.java ├── IPrintWrapper.java ├── IScaleMap.java ├── IMinMap.java ├── IDistanceComparator.java ├── ISubobject.java ├── IVSineMap.java ├── IMaxMap.java ├── ISpringI.java ├── IPixelTexture.java ├── IAddMap.java ├── ISubtractMap.java ├── IUSineMap.java ├── IMatrix3I.java ├── ISurfaceZDepthMap.java ├── IParameterObject.java ├── IParticleOnSurfaceI.java ├── IParticleOnCurveI.java ├── IMatrix4I.java ├── IBoolI.java ├── IAttractorGeo.java ├── ISurfaceDensityMap.java ├── IPointCurlFieldGeo.java ├── ITrimCurveI.java ├── IUStripeShiftMap.java ├── IVStripeShiftMap.java ├── ILineAgent.java ├── ICurvePositionField.java ├── IMeshNormalField.java ├── IRadialComparator.java ├── ICurveTangentField.java ├── ILinkedScalarAgent.java ├── ISurfacePositionField.java ├── I2DSurfacePositionField.java ├── IPlanarAttractor.java ├── ISurfaceNormalField.java ├── I2DSurfaceNormalField.java ├── ICurveAttractorField.java ├── ISurfaceUTangentField.java ├── ISurfaceVTangentField.java ├── ICurveCurlField.java ├── IMatrixI.java ├── I2DSurfaceUTangentField.java ├── I2DSurfaceVTangentField.java ├── ISurfaceAttractorField.java ├── IIntegerI.java ├── IBool.java └── ILineAgentGeo.java /IAppletGL.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gui/IPanelAdapter.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | package igeo.gui; 23 | public interface IPanelAdapter{ 24 | //public void close(); 25 | } -------------------------------------------------------------------------------- /IParticleFactory.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | public interface IParticleFactory { 26 | public IParticleI create(IVecI pos, IVecI vel); 27 | } -------------------------------------------------------------------------------- /p/package-info.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | /** 23 | Processing package of iGeo library. 24 | It provides interface of iGeo to Processing. 25 | */ 26 | package igeo.p; 27 | -------------------------------------------------------------------------------- /ITensionFactory.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | public interface ITensionFactory { 26 | public ITensionI create(IVecI pt1, IVecI pt2, double tension); 27 | } -------------------------------------------------------------------------------- /io/package-info.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | /** 23 | File I/O package of iGeo library. 24 | Classes of 2D or 3D data file importer and exporter 25 | */ 26 | package igeo.io; 27 | -------------------------------------------------------------------------------- /IRandom.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | /** 25 | An alias class of IRand. 26 | 27 | @author Satoru Sugihara 28 | */ 29 | public class IRandom extends IRand{} 30 | -------------------------------------------------------------------------------- /IScalar.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract Scalar (1D) Value Interface 27 | @author Satoru Sugihara 28 | */ 29 | 30 | public interface IScalar extends IVal{} 31 | -------------------------------------------------------------------------------- /IParticleOnCurveFactory.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | public interface IParticleOnCurveFactory { 26 | public IParticleOnCurveI create(ICurveI crv, double upos, IVec pos); 27 | } 28 | -------------------------------------------------------------------------------- /gui/package-info.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | /** 23 | GUI package of iGeo library including UI classes and graphic classes for drawing. 24 | Subclasses of IGraphicSubobject to draw IObject are in this package. 25 | */ 26 | package igeo.gui; 27 | -------------------------------------------------------------------------------- /IMatrixOp.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of matrix operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IMatrixOp extends IParameter{ 31 | public IMatrix get(); 32 | } 33 | -------------------------------------------------------------------------------- /IVal.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract Value Interface (super interface of scalar (1D), 2D vector, 3D vector 4D vector) 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public interface IVal{} 32 | -------------------------------------------------------------------------------- /ICurveOp.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of NURBS curve operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface ICurveOp extends IParameter{ 31 | public ICurveGeo get(); 32 | } 33 | -------------------------------------------------------------------------------- /IMatrix2Op.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of 2x2 matrix operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IMatrix2Op extends IParameter{ 31 | public IMatrix2 get(); 32 | } 33 | -------------------------------------------------------------------------------- /IMatrix3Op.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of 3x3 matrix operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IMatrix3Op extends IParameter{ 31 | public IMatrix3 get(); 32 | } 33 | -------------------------------------------------------------------------------- /IMatrix4Op.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of 4x4 matrix operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IMatrix4Op extends IParameter{ 31 | public IMatrix4 get(); 32 | } 33 | -------------------------------------------------------------------------------- /IVec2Op.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of 2 dimensional vector operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IVec2Op extends IParameter{ 31 | public IVec2 get(); 32 | } 33 | -------------------------------------------------------------------------------- /IVecOp.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of 3 dimensional vector operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IVecOp extends IParameter{ 31 | public IVec get(); 32 | } 33 | -------------------------------------------------------------------------------- /IVolumeOp.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2024 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of NURBS volume operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IVolumeOp extends IParameter{ 31 | public IVolumeGeo get(); 32 | } 33 | -------------------------------------------------------------------------------- /IParameter.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface of abstract operators. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IParameter extends IVal{ 31 | public IParameter get(); 32 | } 33 | -------------------------------------------------------------------------------- /ISurfaceOp.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of NURBS surface operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface ISurfaceOp extends IParameter{ 31 | public ISurfaceGeo get(); 32 | } 33 | -------------------------------------------------------------------------------- /IVec4Op.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of 4 dimensional vector operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IVec4Op extends IVecOp{ 31 | public IVec4 get(); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /IServerI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | An interface to have access to IServer. 27 | @see IServer 28 | 29 | @author Satoru Sugihara 30 | */ 31 | public interface IServerI{ 32 | public IServer server(); 33 | } 34 | -------------------------------------------------------------------------------- /IBoolOp.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of boolean operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IBoolOp extends IParameter, IScalar{ 31 | public boolean x(); 32 | public IBool get(); 33 | } 34 | -------------------------------------------------------------------------------- /IDecay.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface for field decay 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IDecay{ 31 | public double decay(double intensity, double distance, double threshold); 32 | } 33 | -------------------------------------------------------------------------------- /IIntegerOp.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of integer operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IIntegerOp extends IParameter, IScalar{ 31 | public int x(); 32 | public IInteger get(); 33 | } 34 | -------------------------------------------------------------------------------- /IIn.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.io.InputStream; 26 | 27 | /** 28 | A class to provide default static input stream. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IIn { 33 | public static InputStream in = System.in; 34 | } 35 | -------------------------------------------------------------------------------- /IMaterial.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | import java.awt.Color; 27 | import igeo.gui.*; 28 | /** 29 | A super class of rendering material properties 30 | 31 | @author Satoru Sugihara 32 | */ 33 | public class IMaterial{ 34 | } 35 | -------------------------------------------------------------------------------- /IBrepXComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IBrepXComparator extends IGeometryXComparator{} 33 | -------------------------------------------------------------------------------- /IBrepYComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IBrepYComparator extends IGeometryYComparator{} 33 | -------------------------------------------------------------------------------- /IBrepZComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IBrepZComparator extends IGeometryZComparator{} 33 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | iGeo - Java 3D Modeling Library 2 | 3 | http://igeo.jp 4 | 5 | iGeo is free and open source 3D modeling software library 6 | in Java for computational design in architecture, product 7 | design, interaction design and more. It includes libraries 8 | of vector math operations, NURBS curve and surface geometries, 9 | polygon meshes, 3D display and navigation and 3D model file I/O. 10 | It also has an interface called PiGeon specialized for processing. 11 | 12 | 13 | iGeo is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU Lesser General Public License as 15 | published by the Free Software Foundation, version 3. 16 | 17 | iGeo is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU Lesser General Public License for more details. 21 | 22 | You should have received a copy of the GNU Lesser General Public 23 | License along with iGeo. If not, see . 24 | -------------------------------------------------------------------------------- /ICurveXComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class ICurveXComparator extends IGeometryXComparator{} 33 | -------------------------------------------------------------------------------- /ICurveYComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class ICurveYComparator extends IGeometryYComparator{} 33 | -------------------------------------------------------------------------------- /ICurveZComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class ICurveZComparator extends IGeometryZComparator{} 33 | -------------------------------------------------------------------------------- /IDoubleOp.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of double (or 1 dimensional vector) operator. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IDoubleOp extends IParameter, IScalar{ 31 | public double x(); 32 | public IDouble get(); 33 | } 34 | -------------------------------------------------------------------------------- /ISurfaceXComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class ISurfaceXComparator extends IGeometryXComparator{} 33 | -------------------------------------------------------------------------------- /ISurfaceYComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class ISurfaceYComparator extends IGeometryYComparator{} 33 | -------------------------------------------------------------------------------- /ISurfaceZComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class ISurfaceZComparator extends IGeometryZComparator{} 33 | -------------------------------------------------------------------------------- /ISwitchE.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface to be used as to switch methods to return entity instance. 27 | 28 | @see ISwitchR 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface ISwitchE extends ISwitchI{} // switch of entity/reference; entity 33 | -------------------------------------------------------------------------------- /ISwitchR.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface to be used as to switch methods to return reference instance. 27 | 28 | @see ISwitchE 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface ISwitchR extends ISwitchI{} // switch of entity/reference; reference 33 | -------------------------------------------------------------------------------- /ISwitchI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface to be used as to switch methods to return entity or reference instance. 27 | 28 | @see ISwitchE 29 | @see ISwitchR 30 | 31 | @author Satoru Sugihara 32 | */ 33 | public interface ISwitchI{} // switch of entity/reference 34 | -------------------------------------------------------------------------------- /gui/GL2.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | import javax.media.opengl.*; // Processing 1 & 2 26 | //import com.jogamp.opengl.*; // Processing 3 change 27 | 28 | /** 29 | Fake GL2 interface for compiling old GL code 30 | @author Satoru Sugihara 31 | */ 32 | public interface GL2 extends GL{} 33 | -------------------------------------------------------------------------------- /INoDecay.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface for field decay 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class INoDecay implements IDecay{ 31 | public double decay(double intensity, double distance, double threshold){ 32 | return intensity; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /IComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | An interface to define comparator to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface IComparator{ 33 | public int compare(T o1, T o2); // return >0, <0, ==0 34 | } 35 | 36 | -------------------------------------------------------------------------------- /IEntityParameter.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface to mark entity classes which contain actual geometry data inside. 27 | 28 | @see IReferenceParameter 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface IEntityParameter extends IParameter/*, ISwitchE*/{ 33 | } 34 | -------------------------------------------------------------------------------- /IFunction.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface to define a function to output 1 dimensional value taking input of 1 dimensional value. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IFunction{ 31 | public IFunction dup(); 32 | public double eval(double x); 33 | } 34 | -------------------------------------------------------------------------------- /IScalarFieldI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | abstract field function 29 | 30 | @author Satoru Sugihara 31 | */ 32 | 33 | public interface IScalarFieldI extends IFieldI{ 34 | /** get field value at 3D location */ 35 | public IScalar get(IVecI v); 36 | } 37 | -------------------------------------------------------------------------------- /Ie.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Instantiable class of ISwitchE interface to be used as to switch methods to return entity instance. 27 | 28 | @see ISwitchE 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class Ie implements ISwitchE{ 33 | public static final Ie i=new Ie(); 34 | } 35 | -------------------------------------------------------------------------------- /Ir.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Instantiable class of ISwitchR interface to be used as to switch methods to return reference instance. 27 | 28 | @see ISwitchR 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class Ir implements ISwitchR{ 33 | public static final Ir i=new Ir(); 34 | } 35 | -------------------------------------------------------------------------------- /IGraphicI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import igeo.gui.*; 26 | 27 | /** 28 | An interface defining drawing methods. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface IGraphicI{ 33 | public void draw(IGraphics g); 34 | public boolean isDrawable(IGraphicMode m); 35 | public boolean isVisible(); 36 | } 37 | -------------------------------------------------------------------------------- /IConstantMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by one constant number 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IConstantMap extends IMap{ 31 | public double value; 32 | public IConstantMap(double val){ value=val; } 33 | public double get(double u, double v){ return value; } 34 | } 35 | -------------------------------------------------------------------------------- /I2DFieldI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | abstract field function 29 | 30 | @author Satoru Sugihara 31 | */ 32 | 33 | public interface I2DFieldI extends IFieldI{ 34 | /** get field value at 3D location */ 35 | public IVec2I get(IVecI pos); 36 | public IVec2I get(IVecI pos, IVecI vel); 37 | } 38 | -------------------------------------------------------------------------------- /I3DFieldI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | abstract field function 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public interface I3DFieldI extends IFieldI{ 32 | /** get field value at 3D location */ 33 | public IVecI get(IVecI pos); 34 | /** get field value at 3D location with velocity */ 35 | public IVecI get(IVecI pos, IVecI vel); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /IGeometryZComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IGeometryZComparator extends IValueComparator{ 33 | public double value(T g){ 34 | return g.center().z(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /IGeometryXComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IGeometryXComparator extends IValueComparator{ 33 | public double value(T g){ 34 | return g.center().x(); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /IGeometryYComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IGeometryYComparator extends IValueComparator{ 33 | public double value(T g){ 34 | return g.center().y(); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /IGaussDecay.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface for field decay 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IGaussDecay implements IDecay{ 31 | public double decay(double intensity, double distance, double threshold){ 32 | if(threshold==0) return 0; 33 | return intensity * Math.exp(-2*distance*distance/(threshold*threshold)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /IReferenceParameter.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface to mark reference classes which don't contain actual geometry data inside but do only references to them. 27 | 28 | @see IEntityParameter 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface IReferenceParameter extends IParameter/*, ISwitchR*/{ 33 | public IParameter operator(); 34 | } 35 | -------------------------------------------------------------------------------- /package-info.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | /** 23 | Main package of iGeo library. 24 | This contains classes to handle three dimensional geometries, 25 | database of created internal objects and miscellaneous numerical operations. 26 | Old sub-package of igeo.geo (geometry package), igeo.core (core package), 27 | and igeo.util (utility package) are integrated into this main package. 28 | */ 29 | package igeo; 30 | -------------------------------------------------------------------------------- /ILinearDecay.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface for field decay 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class ILinearDecay implements IDecay{ 31 | public double decay(double intensity, double distance, double threshold){ 32 | if(distance >= threshold || threshold==0) return 0; 33 | return intensity*(threshold-distance)/threshold; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /IXComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in X to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IXComparator implements IComparator{ 33 | public int compare(IVec v1, IVec v2){ // return >0, <0, ==0 34 | if(v1.x < v2.x) return -1; 35 | if(v1.x > v2.x) return 1; 36 | return 0; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /IYComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in Y to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IYComparator implements IComparator{ 33 | public int compare(IVec v1, IVec v2){ // return >0, <0, ==0 34 | if(v1.y < v2.y) return -1; 35 | if(v1.y > v2.y) return 1; 36 | return 0; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /IZComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in Z to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IZComparator implements IComparator{ 33 | public int compare(IVec v1, IVec v2){ // return >0, <0, ==0 34 | if(v1.z < v2.z) return -1; 35 | if(v1.z > v2.z) return 1; 36 | return 0; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /IArithmeticVal.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract Scalar (1D) Value Interface 27 | @author Satoru Sugihara 28 | */ 29 | 30 | public interface IArithmeticVal extends IVal{ 31 | public T add(T val); 32 | public T sub(T val); 33 | public T mul(S val); 34 | public T div(S val); 35 | public T zero(); 36 | public T dup(); 37 | public T cp(); // alias of dup 38 | public T set(T val); 39 | } 40 | -------------------------------------------------------------------------------- /ITrajectoryI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | Interface of trajectory API 29 | @author Satoru Sugihara 30 | */ 31 | public interface ITrajectoryI{ 32 | /** returns trajectory curve object */ 33 | public ICurve curve(); 34 | /** alias of curve() */ 35 | public ICurve trajectory(); 36 | 37 | /** add a point at the end of trajectory curve */ 38 | public ITrajectoryI addCP(IVecI pt); 39 | } 40 | -------------------------------------------------------------------------------- /IStraightenerI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | Interface API of straightener (straightening force) classes 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface IStraightenerI extends ITensionI{ 33 | 34 | /** getting end point3. */ 35 | public IParticleI pt3(); 36 | /** alias of pt3() */ 37 | public IParticleI particle3(); 38 | /** position of particle3() */ 39 | public IVec pos3(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /gui/IGraphics2D.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | 26 | /** 27 | Class of Graphics to draw 2D (Java2D) 28 | 29 | @author Satoru Sugihara 30 | */ 31 | public interface IGraphics2D extends IGraphics{ 32 | 33 | // J2D 34 | // point 35 | //public void drawPoint(IVec2 p); 36 | // line 37 | //public void drawLines(IVec2[] p); 38 | //public void drawLines(IVec2[] p); 39 | // bezier 40 | // polygon 41 | // surface? 42 | 43 | // stroke color 44 | } 45 | -------------------------------------------------------------------------------- /IFoldable.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface of foldable/unfoldable geometry. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IFoldable{ 31 | 32 | /** unfold at origin on XY plane */ 33 | public IFoldable unfold(); 34 | /** unfold at origin on the given plane */ 35 | public IFoldable unfold(IVecI planeNormal); 36 | /** unfold at the plane point on the given plane */ 37 | public IFoldable unfold(IVecI planeNormal, IVecI planePt); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /ILinkedVec2Agent.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Agent class with a generic data with links to other data agents 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class ILinkedVec2Agent extends ILinkedDataAgent{ 31 | 32 | public ILinkedVec2Agent(){ super(); } 33 | public ILinkedVec2Agent(IVec2I val){ super(val); } 34 | //public ILinkedVec2Agent(IObject parent){ super(parent); } 35 | //public ILinkedVec2Agent(IVec2I val, IObject parent){ super(val,parent); } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /p/PIApplet.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.p; 24 | 25 | import processing.core.*; 26 | 27 | import igeo.IG; 28 | 29 | /** 30 | A child class of Processing's PApplet. 31 | Currently only used for debugging. 32 | 33 | @author Satoru Sugihara 34 | */ 35 | public class PIApplet extends PApplet{ 36 | static int defaultWidth=480; 37 | static int defaultHeight=320; 38 | 39 | public void setup(){ 40 | size(defaultWidth, defaultHeight, IG.GL); 41 | } 42 | 43 | //public void draw(){} 44 | 45 | } 46 | -------------------------------------------------------------------------------- /IParticleOnMeshGeo.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | Class of an implementation of IDynamics to have physical attributes of point on a cureve. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IParticleOnMeshGeo extends IParticleGeo /*implements IParticleOnCurveI*/{ 33 | 34 | public IMeshI mesh; 35 | public IFace face; // current face on which particle is 36 | 37 | public IParticleOnMeshGeo(IMeshI mesh){ this.mesh = mesh; } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /ISubMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by extracting part of another map. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class ISubMap extends IMap{ 31 | public IMap map; 32 | public double u1,u2,v1,v2; 33 | public ISubMap(IMap mp, double ustart, double uend, double vstart, double vend){ 34 | map=mp; 35 | u1=ustart; 36 | u2=uend; 37 | v1=vstart; 38 | v2=vend; 39 | } 40 | public double get(double u, double v){ return map.get((u2-u1)*u+u1,(v2-v1)*v+v1); } 41 | } 42 | -------------------------------------------------------------------------------- /IValueComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | An interface to define comparator to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public abstract class IValueComparator implements IComparator{ 33 | abstract public double value(T o); 34 | public int compare(T o1, T o2){ // return >0, <0, ==0 35 | double v1 = value(o1); 36 | double v2 = value(o2); 37 | if(v1>v2) return 1; 38 | if(v1. 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by flipping another map in u direction. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IUFlipMap extends IMap{ 31 | public IMap map; 32 | public IUFlipMap(IMap m){ map = m; } 33 | public double get(double u, double v){ return map.get(1-u,v); } 34 | public IUFlipMap flipU(){ map.flipU(); return this; } //is it ok to modify the original? 35 | public IUFlipMap flipV(){ map.flipV(); return this; } //is it ok to modify the original? 36 | } 37 | -------------------------------------------------------------------------------- /IVFlipMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by flipping another map in v direction. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IVFlipMap extends IMap{ 31 | public IMap map; 32 | public IVFlipMap(IMap m){ map = m; } 33 | public double get(double u, double v){ return map.get(u,1-v); } 34 | public IVFlipMap flipU(){ map.flipU(); return this; } //is it ok to modify the original? 35 | public IVFlipMap flipV(){ map.flipV(); return this; } //is it ok to modify the original? 36 | } 37 | 38 | -------------------------------------------------------------------------------- /gui/ITextureGraphicGL.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | //import javax.media.opengl.*; // Processing 1 & 2 26 | import com.jogamp.opengl.GL; // Processing 3 27 | import java.awt.image.*; 28 | import igeo.*; 29 | 30 | /** 31 | Texture graphic interface 32 | */ 33 | public interface ITextureGraphicGL{ 34 | public void init(String filename, GL gl); 35 | public void init(BufferedImage image, GL gl); 36 | public int id(); 37 | public int width(); 38 | public int height(); 39 | public void destroy(GL gl); 40 | public void destroy(); 41 | } 42 | -------------------------------------------------------------------------------- /IInvertMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by inverting value from 0 to 1 and 1 to 0. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IInvertMap extends IMap{ 31 | public IMap map; 32 | public IInvertMap(IMap m){ map = m; } 33 | public double get(double u, double v){ return 1.0 - map.get(u,v); } 34 | public IInvertMap flipU(){ map.flipU(); return this; } //is it ok to modify the original? 35 | public IInvertMap flipV(){ map.flipV(); return this; } //is it ok to modify the original? 36 | } 37 | 38 | -------------------------------------------------------------------------------- /ILinkedVecAgent.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Agent class with a generic data with links to other data agents 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class ILinkedVecAgent extends ILinkedDataAgent{ 31 | 32 | public ILinkedVecAgent(){ super(); } 33 | //public ILinkedVecAgent(IVecI val){ super(val); } 34 | public ILinkedVecAgent(IVecI pos, IVecI val){ super(pos, val); } 35 | //public ILinkedVecAgent(IObject parent){ super(parent); } 36 | //public ILinkedVecAgent(IVecI val, IObject parent){ super(val,parent); } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /IDirectionalComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in a specified direction to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IDirectionalComparator implements IComparator{ 33 | public IVec dir; 34 | public IDirectionalComparator(IVec dir){ this.dir = dir; } 35 | 36 | public int compare(IVec v1, IVec v2){ // return >0, <0, ==0 37 | double d1 = v1.dot(dir); 38 | double d2 = v2.dot(dir); 39 | if(d1 < d2) return -1; 40 | if(d1 > d2) return 1; 41 | return 0; 42 | } 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /IMatrix2I.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface of 2x2 numerical matrix. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IMatrix2I extends IMatrixI, IMatrix2Op{ 31 | 32 | public IMatrix2 get(); 33 | 34 | public IMatrix2I dup(); 35 | public IMatrix2I cp(); 36 | 37 | public IMatrix2I set(double v11, double v12, 38 | double v21, double v22); 39 | 40 | public IMatrix2I set(IDoubleI v11, IDoubleI v12, 41 | IDoubleI v21, IDoubleI v22); 42 | 43 | public IMatrix2I mul(IMatrix2I m); 44 | 45 | public IVec2I mul(IVec2I m); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /gui/IGraphicsGL.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | 26 | import igeo.*; 27 | 28 | //import javax.media.opengl.*; // Processing 1 & 2 29 | import com.jogamp.opengl.*; // Processing 3 30 | 31 | import java.awt.image.*; 32 | 33 | /** 34 | Interface of Graphics to draw 3D geometry with OpenGL 35 | @author Satoru Sugihara 36 | */ 37 | public interface IGraphicsGL extends IGraphics3D{ 38 | public GL getGL(); 39 | public void setGL(GL g); 40 | public void setBGImage(String imageFilename); 41 | 42 | public ITextureGraphicGL getTextureGraphic(String filename); 43 | public ITextureGraphicGL getTextureGraphic(BufferedImage image); 44 | } 45 | -------------------------------------------------------------------------------- /p/PIInput.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.p; 24 | 25 | import processing.core.*; 26 | import java.io.*; 27 | import igeo.io.IInputWrapper; 28 | 29 | import igeo.*; 30 | 31 | /** 32 | Input wrapper class. Mostly for wrapping Processing's input stream method. 33 | 34 | @author Satoru Sugihara 35 | */ 36 | public class PIInput extends IInputWrapper{ 37 | public PApplet papplet; 38 | public PIInput(PApplet p){ papplet = p; } 39 | public InputStream getStream(String filename){ 40 | return papplet.createInput(filename); 41 | } 42 | public InputStream getStream(File file){ 43 | return papplet.createInput(file.getName()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /IMultiplyMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by multiplication of two maps. 27 | Output value is NOT crampped. 28 | 29 | @author Satoru Sugihara 30 | */ 31 | public class IMultiplyMap extends IMap{ 32 | public IMap map1, map2; 33 | public IMultiplyMap(IMap m1,IMap m2){ map1=m1; map2=m2; } 34 | public double get(double u, double v){ return map1.get(u,v)*map2.get(u,v); } 35 | public IMultiplyMap flipU(){ map1.flipU(); map2.flipU(); return this; } //is it ok to modify the original? 36 | public IMultiplyMap flipV(){ map1.flipV(); map2.flipV(); return this; } //is it ok to modify the original? 37 | } 38 | -------------------------------------------------------------------------------- /IBasicMaterial.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | 26 | /** 27 | A Class of rendering material properties for IObject geometries. 28 | In the current version, this material information is not used yet. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | 33 | public class IBasicMaterial extends IMaterial{ 34 | public IColor ambient; 35 | public IColor diffuse; 36 | public IColor emission; 37 | public IColor specular; 38 | public IColor reflection; 39 | public IColor transparent; 40 | public double refraction = 1.; 41 | public double reflectivity = 0.; 42 | public double shine = 0.; 43 | public double transparency = 0.; 44 | } 45 | -------------------------------------------------------------------------------- /IPrintWrapper.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.io.*; 26 | import java.util.Arrays; 27 | 28 | public class IPrintWrapper extends OutputStream{ 29 | public IPrintWrapper(){} 30 | 31 | public void p(String str) {} 32 | 33 | public void write(byte[] b){ 34 | p(new String(b)); 35 | } 36 | 37 | public void write(byte[] b, int off, int len){ 38 | //p(new String(Arrays.copyOfRange(b, off, off+len))); // for jdk1.6+ 39 | byte[] b2 = new byte[len]; 40 | for(int i=0; i. 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by scaling another map. 27 | Output value is crampped with 0.0 - 1.0. 28 | 29 | @author Satoru Sugihara 30 | */ 31 | public class IScaleMap extends IMap{ 32 | public IMap map; 33 | public double scaleFactor; 34 | public IScaleMap(IMap m, double factor){ map = m; scaleFactor = factor; } 35 | public double get(double u, double v){ return map.get(u,v)*scaleFactor; } 36 | public IScaleMap flipU(){ map.flipU(); return this; } //is it ok to modify the original? 37 | public IScaleMap flipV(){ map.flipV(); return this; } //is it ok to modify the original? 38 | } 39 | 40 | -------------------------------------------------------------------------------- /IMinMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by taking smaller value of two maps. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IMinMap extends IMap{ 31 | public IMap map1, map2; 32 | public IMinMap(IMap m1,IMap m2){ map1=m1; map2=m2; } 33 | public double get(double u, double v){ 34 | double v1 = map1.get(u,v); 35 | double v2 = map2.get(u,v); 36 | if(v1. 20 | 21 | ---*/ 22 | 23 | package igeo.io; 24 | 25 | import java.io.*; 26 | import igeo.*; 27 | 28 | /** 29 | Input wrapper class. Mostly for wrapping Processing's input stream method. 30 | 31 | @author Satoru Sugihara 32 | */ 33 | public class IInputWrapper{ 34 | 35 | public InputStream getStream(String filename){ 36 | InputStream is = null; 37 | try{ is = new FileInputStream(filename); }catch(IOException e){ e.printStackTrace(); } 38 | return is; 39 | } 40 | 41 | public InputStream getStream(File file){ 42 | InputStream is = null; 43 | try{ is = new FileInputStream(file); }catch(IOException e){ e.printStackTrace(); } 44 | return is; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /IDistanceComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in a specified direction to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IDistanceComparator implements IComparator{ 33 | public IVec center = new IVec(0,0,0); 34 | public IDistanceComparator(){} 35 | public IDistanceComparator(IVec center){ this.center = center; } 36 | 37 | public int compare(IVec v1, IVec v2){ // return >0, <0, ==0 38 | double d1 = v1.dist(center); 39 | double d2 = v2.dist(center); 40 | if(d1 < d2) return -1; 41 | if(d1 > d2) return 1; 42 | return 0; 43 | } 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /ISubobject.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A base class of subobjects to be contained by IObject. 27 | 28 | @see IObject 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public /*class*/ interface ISubobject /*implements ISubelementI*/{ 33 | //public IObject parent=null; 34 | ////public ISubobject(){} 35 | ////public ISubobject(IServerI holder){} 36 | //public IObject parent(){ return parent; } 37 | //public ISubobject parent(IObject parent){ this.parent=parent; return this; } 38 | 39 | /** getting parent object */ 40 | public IObject parent(); 41 | /** setting parent object */ 42 | public ISubobject parent(IObject parent); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /IVSineMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by sine curve in v direction. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IVSineMap extends IMap{ 31 | public double minValue, maxValue; 32 | public double frequency; 33 | public double phase; 34 | 35 | public IVSineMap(double minamp, double maxamp, double freq, double phs){ 36 | minValue = minamp; 37 | maxValue = maxamp; 38 | frequency = freq; 39 | phase = phs; 40 | } 41 | public double get(double u, double v){ return get(v); } 42 | public double get(double x){ 43 | return (Math.sin( (x-phase)*frequency*2*Math.PI)+1)/2*(maxValue-minValue)+minValue; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /IMaxMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import igeo.gui.*; 26 | 27 | /** 28 | A subclass of IMap defined by taking larger value of two maps. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IMaxMap extends IMap{ 33 | public IMap map1, map2; 34 | public IMaxMap(IMap m1,IMap m2){ map1=m1; map2=m2; } 35 | public double get(double u, double v){ 36 | double v1 = map1.get(u,v); 37 | double v2 = map2.get(u,v); 38 | if(v1>v2) return v1; 39 | return v2; 40 | } 41 | public IMaxMap flipU(){ map1.flipU(); map2.flipU(); return this; } //is it ok to modify the original? 42 | public IMaxMap flipV(){ map1.flipV(); map2.flipV(); return this; } //is it ok to modify the original? 43 | } 44 | -------------------------------------------------------------------------------- /ISpringI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | Interface API of straightener (straightening force) classes 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface ISpringI extends ITensionI{ 33 | 34 | /** get length */ 35 | public double len(); 36 | /** set length */ 37 | public ISpringI len(double length); 38 | /** set length by two points */ 39 | public ISpringI len(IVecI p1, IVecI p2); 40 | 41 | /** alias of len */ 42 | public double length(); 43 | /** alias of len */ 44 | public ISpringI length(double length); 45 | /** alias of len */ 46 | public ISpringI length(IVecI p1, IVecI p2); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /IPixelTexture.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.awt.image.*; 26 | import java.awt.*; 27 | 28 | import igeo.*; 29 | import igeo.gui.*; 30 | 31 | /** 32 | Texture class out of matrix of pixels 33 | */ 34 | public class IPixelTexture extends ITexture{ 35 | public int[] pixels; 36 | 37 | /** constructor with pixel size */ 38 | public IPixelTexture(int width, int height){ 39 | super(width,height); 40 | pixels = ((DataBufferInt)image.getRaster().getDataBuffer()).getData(); 41 | } 42 | 43 | public IPixelTexture(String file, int width, int height){ 44 | super(file, width, height); 45 | pixels = ((DataBufferInt)image.getRaster().getDataBuffer()).getData(); 46 | } 47 | 48 | 49 | } -------------------------------------------------------------------------------- /IAddMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by addition of two maps. 27 | Output value is crampped with 0.0 - 1.0. 28 | 29 | @author Satoru Sugihara 30 | */ 31 | public class IAddMap extends IMap{ 32 | public IMap map1, map2; 33 | public IAddMap(IMap m1,IMap m2){ map1=m1; map2=m2; } 34 | public double get(double u, double v){ 35 | double val = map1.get(u,v) + map2.get(u,v); 36 | if(val>1) return 1; 37 | if(val<0) return 0; 38 | return val; 39 | } 40 | public IAddMap flipU(){ map1.flipU(); map2.flipU(); return this; } //is it ok to modify the original? 41 | public IAddMap flipV(){ map1.flipV(); map2.flipV(); return this; } //is it ok to modify the original? 42 | } 43 | -------------------------------------------------------------------------------- /ISubtractMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by subtraction of two maps. 27 | Output value is crampped with 0.0 - 1.0. 28 | 29 | @author Satoru Sugihara 30 | */ 31 | public class ISubtractMap extends IMap{ 32 | public IMap map1, map2; 33 | public ISubtractMap(IMap m1,IMap m2){ map1=m1; map2=m2; } 34 | public double get(double u, double v){ 35 | double val = map1.get(u,v) - map2.get(u,v); 36 | if(val>1) return 1; 37 | if(val<0) return 0; 38 | return val; 39 | } 40 | public ISubtractMap flipU(){ map1.flipU(); map2.flipU(); return this; } //is it ok to modify the original? 41 | public ISubtractMap flipV(){ map1.flipV(); map2.flipV(); return this; } //is it ok to modify the original? 42 | } 43 | -------------------------------------------------------------------------------- /IUSineMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import igeo.gui.*; 26 | 27 | /** 28 | A subclass of IMap defined by sine curve in u direction. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IUSineMap extends IMap{ 33 | public double minValue, maxValue; 34 | public double frequency; 35 | public double phase; 36 | 37 | public IUSineMap(double minamp, double maxamp, double freq, double phs){ 38 | minValue = minamp; 39 | maxValue = maxamp; 40 | frequency = freq; 41 | phase = phs; 42 | } 43 | 44 | public double get(double u, double v){ 45 | return get(u); 46 | } 47 | public double get(double x){ 48 | return (Math.sin( (x-phase)*2*Math.PI*frequency )+1)/2*(maxValue-minValue)+minValue; 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /IMatrix3I.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface of 3x3 numerical matrix. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IMatrix3I extends IMatrixI, IMatrix3Op{ 31 | 32 | public IMatrix3 get(); 33 | 34 | public IMatrix3I dup(); 35 | public IMatrix3I cp(); 36 | 37 | public IMatrix3I set(double v11, double v12, double v13, 38 | double v21, double v22, double v23, 39 | double v31, double v32, double v33); 40 | 41 | public IMatrix3I set(IDoubleI v11, IDoubleI v12, IDoubleI v13, 42 | IDoubleI v21, IDoubleI v22, IDoubleI v23, 43 | IDoubleI v31, IDoubleI v32, IDoubleI v33); 44 | 45 | public IMatrix3I mul(IMatrix3I m); 46 | 47 | public IVecI mul(IVecI m); 48 | 49 | public IVec2I mul(IVec2I m); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /ISurfaceZDepthMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by z depth of surface. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class ISurfaceZDepthMap extends ISurfaceDepthMap{ 31 | public ISurfaceZDepthMap(ISurfaceI surf, double minZ, double maxZ){ 32 | super(surf, new IVec(0,0,1), new IVec(0,0,minZ), new IVec(0,0,maxZ)); 33 | } 34 | 35 | public ISurfaceZDepthMap(ISurfaceI surf){ 36 | super(surf, new IVec(0,0,1), new IVec(0,0,0), new IVec(0,0,1)); 37 | 38 | final int usampleNum=20; 39 | final int vsampleNum=20; 40 | double minz=0,maxz=0; 41 | // check limit by control points 42 | for(int i=0; imaxz) maxz=z; 49 | } 50 | } 51 | } 52 | minDepthPt.set(0,0,minz); 53 | maxDepth = maxz-minz; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /gui/IMouseWheelEvent.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | import java.awt.*; 26 | import java.awt.event.*; 27 | 28 | /** 29 | Abstracted mouse wheel event 30 | 31 | @author Satoru Sugihara 32 | */ 33 | public class IMouseWheelEvent{ 34 | 35 | public int rotation; 36 | public int scrollAmount; 37 | public int scrollType; 38 | 39 | public IMouseWheelEvent(){} 40 | public IMouseWheelEvent(int rot){ rotation = rot; } 41 | public IMouseWheelEvent(MouseWheelEvent e){ 42 | rotation = e.getWheelRotation(); 43 | scrollAmount = e.getScrollAmount(); 44 | scrollType = e.getScrollType(); 45 | } 46 | 47 | // doesn't compile in processing 1.5 48 | public IMouseWheelEvent(processing.event.MouseEvent e){ 49 | rotation = e.getCount(); 50 | scrollAmount = 1; // not sure 51 | scrollType = MouseWheelEvent.WHEEL_UNIT_SCROLL; 52 | } 53 | 54 | 55 | public int getScrollAmount(){ return scrollAmount; } 56 | public int getScrollType(){ return scrollType; } 57 | public int getWheelRotation(){ return rotation; } 58 | } 59 | -------------------------------------------------------------------------------- /IParameterObject.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subobject of IObject to contain numerical geometry data 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IParameterObject /*extends*/ implements ISubobject{ 31 | 32 | public IObject parent; 33 | 34 | /** 35 | default constractor doesn't instantiate parent IObject 36 | */ 37 | public IParameterObject(){} 38 | 39 | /** 40 | constractor with IServerI arument instantiate parent element and stores in 41 | the IServer in the holder if the argument is not null. 42 | if the argument is null, it's stored in default (static current) IServer 43 | */ 44 | public IParameterObject(IServerI holder){ 45 | createObject(holder); 46 | } 47 | 48 | protected void createObject(IServerI holder){ 49 | parent = new IObject(holder); 50 | parent.setParameter(this); 51 | } 52 | 53 | // implementation of ISubobject 54 | public IObject parent(){ return parent; } 55 | public ISubobject parent(IObject parent){ this.parent=parent; return this; } 56 | 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /gui/ITextureGraphicGL1.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | import javax.media.opengl.*; // Processing 1 & 2 26 | 27 | import java.awt.geom.*; 28 | import java.awt.image.*; 29 | import java.awt.*; 30 | import java.io.*; 31 | 32 | import igeo.*; 33 | 34 | /** 35 | Texture graphic class for processing 1 (not implemented yet) 36 | */ 37 | public class ITextureGraphicGL1 implements ITextureGraphicGL{ 38 | /** constructor with image file name */ 39 | public ITextureGraphicGL1(String filename){ 40 | init(filename,null); 41 | } 42 | 43 | /** constructor with image file name */ 44 | public ITextureGraphicGL1(String filename, GL gl){ 45 | init(filename,gl); 46 | } 47 | 48 | /** constructor with AWT buffered image */ 49 | public ITextureGraphicGL1(BufferedImage image, GL gl){ 50 | init(image, gl); 51 | } 52 | public void init(String filename, GL gl){} 53 | public void init(BufferedImage image, GL gl){} 54 | public int id(){ return 0; } 55 | public int width(){ return 0; } 56 | public int height(){ return 0; } 57 | public void destroy(GL gl){} 58 | public void destroy(){} 59 | } -------------------------------------------------------------------------------- /IParticleOnSurfaceI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of a particle who sits and moves on a surface 27 | @author Satoru Sugihara 28 | */ 29 | public interface IParticleOnSurfaceI extends IParticleI{ 30 | 31 | public ISurfaceI surface(); 32 | 33 | public IParticleOnSurfaceI uv(double u, double v); 34 | public IVec2 uv(); 35 | public IParticleOnSurfaceI uvvel(double uvel, double vvel); 36 | public IVec2 uvvel(); 37 | public IParticleOnSurfaceI uvfrc(double ufrc, double vfrc); 38 | public IVec2 uvfrc(); 39 | 40 | public IParticleOnSurfaceI addUVForce(double ufrc, double vfrc); 41 | public IParticleOnSurfaceI resetUVForce(); 42 | 43 | public IParticleOnSurfaceI uvpush(double ufrc, double vfrc); 44 | public IParticleOnSurfaceI uvpull(double ufrc, double vfrf); 45 | public IParticleOnSurfaceI uvreset(); 46 | 47 | public IParticleOnSurfaceI fixU(); 48 | public IParticleOnSurfaceI fixV(); 49 | public IParticleOnSurfaceI unfixU(); 50 | public IParticleOnSurfaceI unfixV(); 51 | public boolean uFixed(); 52 | public boolean vFixed(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /IParticleOnCurveI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Class of an implementation of IDynamicObject to have physical attributes of point. 27 | It has attributes of position, velocity, acceleration, force, and mass. 28 | Position is provided from outside to be linked. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public interface IParticleOnCurveI extends IParticleI{ 33 | 34 | public ICurveI curve(); 35 | 36 | public IParticleOnCurveI uposition(double u); 37 | public IParticleOnCurveI upos(double u); 38 | public double uposition(); 39 | public double upos(); 40 | public IParticleOnCurveI uvelocity(double uv); 41 | public IParticleOnCurveI uvel(double uv); 42 | public double uvelocity(); 43 | public double uvel(); 44 | public IParticleOnCurveI uforce(double uf); 45 | public IParticleOnCurveI ufrc(double uf); 46 | public double uforce(); 47 | public double ufrc(); 48 | 49 | public IParticleOnCurveI addUForce(double uforce); 50 | public IParticleOnCurveI resetUForce(); 51 | 52 | public IParticleOnCurveI upush(double uforce); 53 | public IParticleOnCurveI upull(double uforce); 54 | public IParticleOnCurveI ureset(); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /IMatrix4I.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface of 4x4 numerical matrix. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IMatrix4I extends IMatrixI, IMatrix4Op{ 31 | 32 | public IMatrix4 get(); 33 | 34 | public IMatrix4I dup(); 35 | public IMatrix4I cp(); 36 | 37 | public IMatrix4I set(double v11, double v12, double v13, double v14, 38 | double v21, double v22, double v23, double v24, 39 | double v31, double v32, double v33, double v34, 40 | double v41, double v42, double v43, double v44); 41 | 42 | public IMatrix4I set(IDoubleI v11, IDoubleI v12, IDoubleI v13, IDoubleI v14, 43 | IDoubleI v21, IDoubleI v22, IDoubleI v23, IDoubleI v24, 44 | IDoubleI v31, IDoubleI v32, IDoubleI v33, IDoubleI v34, 45 | IDoubleI v41, IDoubleI v42, IDoubleI v43, IDoubleI v44); 46 | 47 | public IMatrix4I mul(IMatrix4I m); 48 | 49 | public IVec4I mul(IVec4I m); 50 | 51 | public IVecI mul(IVecI m); 52 | /** 53 | same with mul(IVecI) 54 | */ 55 | public IVecI transform(IVecI m); 56 | 57 | /** get matrix without translation part */ 58 | public IMatrix3I matrix3(); 59 | /** get only translate vector */ 60 | public IVecI translate(); 61 | 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /IBoolI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of boolean to be used as IParameterObject. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IBoolI extends IBoolOp{ 31 | /** 32 | @return primitive value 33 | */ 34 | public boolean x(); 35 | 36 | /** 37 | @return fixed value but in wrapper class 38 | */ 39 | public IBool get(); 40 | 41 | /** 42 | @return generic parameter of the value (either of entity class or reference class) (in one dimensional data, it's same with the instance itself) 43 | */ 44 | public IBoolI getX(); 45 | 46 | /** 47 | @return duplicated instance 48 | */ 49 | public IBoolI dup(); 50 | 51 | /** alias of dup() */ 52 | public IBoolI cp(); 53 | 54 | /** 55 | convert reference tree to one constant value 56 | */ 57 | //public IBoolI const(); 58 | 59 | public IBoolI set(IBoolI v); 60 | public IBoolI set(boolean v); 61 | 62 | public IBoolI and(IBoolI v); 63 | public IBoolI and(boolean v); 64 | public IBoolI or(IBoolI v); 65 | public IBoolI or(boolean v); 66 | public IBoolI not(); 67 | 68 | public boolean eq(IBoolI v); 69 | //public IBoolI eqR(IBoolI v); 70 | public boolean eq(ISwitchE e, IBoolI v); 71 | public IBoolI eq(ISwitchR r, IBoolI v); 72 | 73 | } 74 | -------------------------------------------------------------------------------- /IAttractorGeo.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | 26 | /** 27 | Attractor field defined by a center point. 28 | 29 | @author Satoru Sugihara 30 | */ 31 | 32 | public class IAttractorGeo extends IPointFieldGeo{ 33 | public IAttractorGeo(IVecI p){ super(p,null); } 34 | public IVecI getForce(IVecI v, IVecI orig){ return orig.dif(v); } 35 | 36 | public IAttractorGeo noDecay(){ super.noDecay(); return this; } 37 | public IAttractorGeo linearDecay(double threshold){ super.linearDecay(threshold); return this; } 38 | public IAttractorGeo linear(double threshold){ super.linear(threshold); return this; } 39 | public IAttractorGeo gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 40 | public IAttractorGeo gaussian(double threshold){ super.gaussian(threshold); return this; } 41 | public IAttractorGeo gauss(double threshold){ super.gauss(threshold); return this; } 42 | public IAttractorGeo constantIntensity(boolean b){ super.constantIntensity(b); return this; } 43 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 44 | public IAttractorGeo bidirectional(boolean b){ super.bidirectional(b); return this; } 45 | 46 | public IAttractorGeo threshold(double t){ super.threshold(t); return this; } 47 | public IAttractorGeo intensity(double i){ super.intensity(i); return this; } 48 | } 49 | -------------------------------------------------------------------------------- /p/PIConfig.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.p; 24 | 25 | /** 26 | Configuration setting class for the processing interface piGeon. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class PIConfig{ 31 | /** 32 | This boolean flag specifies the order of drawing of iGeo and Processing. 33 | If it's true iGeo is drawn before Processing's draw() method. 34 | Otherwise, drawn after Processing's draw() method. 35 | Default is true. 36 | */ 37 | public static boolean drawBeforeProcessing=true; 38 | 39 | /** 40 | A boolean flag to switch for PIGraphicsGL to clear OpenGL's GL_DEPTH_BUFFER_BIT 41 | before drawing iGeo's geometries. Default is true. 42 | */ 43 | public static boolean resetGLDepthBefore=true; 44 | 45 | /** 46 | A boolean flag to switch for PIGraphicsGL to clear OpenGL's GL_DEPTH_BUFFER_BIT 47 | after drawing iGeo's geometries. Default is true. 48 | */ 49 | public static boolean resetGLDepthAfter=true; 50 | 51 | /** 52 | A switch to enable resizing the frame (window). Default true. 53 | */ 54 | public static boolean resizable = true; 55 | 56 | /** 57 | restore Processing's original viewport in case some GL drawing is done in original Processing before iGeo. 58 | Warning: if this option is true, runtime resizing of window will crash. 59 | */ 60 | public static boolean restoreGLViewport = false; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /ISurfaceDensityMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A subclass of IMap defined by accumulated curvature of a surface 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class ISurfaceDensityMap extends IMap{ 31 | public ISurfaceI surface; 32 | public IVec orig, uvec, vvec; 33 | 34 | /** 35 | @param surf surface should be rectangle 36 | */ 37 | public ISurfaceDensityMap(ISurfaceI surf){ 38 | surface=surf; 39 | initMap(); 40 | } 41 | 42 | public ISurfaceDensityMap initMap(){ 43 | orig = surface.corner(0,0).get(); 44 | uvec = surface.corner(1,0).diff(orig).get(); 45 | vvec = surface.corner(0,1).diff(orig).get(); 46 | return this; 47 | } 48 | 49 | public ISurfaceDensityMap initDensityMapU(int width, int height){ return this; } // do nothing 50 | 51 | public double projectU(double u, double v){ 52 | IVec pt = surface.pt(u,v).get(); 53 | pt.sub(orig); 54 | double[] coeff = pt.projectTo2Vec(uvec,vvec); 55 | return coeff[0]; 56 | } 57 | 58 | public double projectV(double u, double v){ 59 | IVec pt = surface.pt(u,v).get(); 60 | pt.sub(orig); 61 | double[] coeff = pt.projectTo2Vec(uvec,vvec); 62 | return coeff[1]; 63 | } 64 | 65 | public IVec2 project(double u, double v){ 66 | IVec pt = surface.pt(u,v).get(); 67 | pt.sub(orig); 68 | double[] coeff = pt.projectTo2Vec(uvec,vvec); 69 | return new IVec2(coeff[0],coeff[1]); 70 | } 71 | 72 | } 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /gui/IComponent.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | import igeo.IG; 26 | 27 | /** 28 | Base class of custom GUI components. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IComponent{ 33 | public int x, y, width, height; 34 | public boolean visible=false; 35 | 36 | public IComponent(int x, int y, int width, int height){ 37 | this.x=x; this.y=y; this.width=width; this.height=height; 38 | } 39 | 40 | public void setBounds(int x, int y, int width, int height){ 41 | this.x=x; this.y=y; this.width=width; this.height=height; 42 | } 43 | public void setBounds(IComponent c){ x=c.x; y=c.y; width=c.width; height=c.height; } 44 | public void setLocation(int x, int y){ this.x=x; this.y=y; } 45 | public void setSize(int width, int height){ this.width=width; this.height=height; } 46 | 47 | public float getX(){ return x; } 48 | public float getY(){ return y; } 49 | public int getWidth(){ return width; } 50 | public int getHeight(){ return height; } 51 | 52 | 53 | public boolean isVisible(){ return visible; } 54 | public void setVisible(boolean v){ visible=v; } 55 | //public void hide(){ visible=false; } 56 | //public void show(){ visible=true; } 57 | 58 | public boolean contains(int x, int y){ 59 | if(x < this.x) return false; 60 | if(y < this.y) return false; 61 | if(x >= (this.x+width)) return false; 62 | if(y >= (this.y+height)) return false; 63 | return true; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /IPointCurlFieldGeo.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | 26 | /** 27 | Curl field defined by a point and an axis vector. 28 | 29 | @author Satoru Sugihara 30 | */ 31 | 32 | public class IPointCurlFieldGeo extends IPointFieldGeo{ 33 | public IPointCurlFieldGeo(IVecI pos, IVecI axis){ super(pos,axis); } 34 | 35 | public IVecI getForce(IVecI v, IVecI orig){ return orig.get().dif(v).icross(dir); } 36 | 37 | public IPointCurlFieldGeo noDecay(){ super.noDecay(); return this; } 38 | public IPointCurlFieldGeo linearDecay(double threshold){ super.linearDecay(threshold); return this; } 39 | public IPointCurlFieldGeo linear(double threshold){ super.linear(threshold); return this; } 40 | public IPointCurlFieldGeo gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 41 | public IPointCurlFieldGeo gaussian(double threshold){ super.gaussian(threshold); return this; } 42 | public IPointCurlFieldGeo gauss(double threshold){ super.gauss(threshold); return this; } 43 | public IPointCurlFieldGeo constantIntensity(boolean b){ super.constantIntensity(b); return this; } 44 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 45 | public IPointCurlFieldGeo bidirectional(boolean b){ super.bidirectional(b); return this; } 46 | 47 | public IPointCurlFieldGeo threshold(double t){ super.threshold(t); return this; } 48 | public IPointCurlFieldGeo intensity(double i){ super.intensity(i); return this; } 49 | } 50 | -------------------------------------------------------------------------------- /ITrimCurveI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of trim curve of surface. 27 | A trim curve is either outer trim curve (outside edge) or inner trim curve (edge of hole). 28 | 29 | @author Satoru Sugihara 30 | */ 31 | public interface ITrimCurveI extends ICurveI{ 32 | 33 | /** set surface 34 | */ 35 | public ITrimCurveI surface(ISurfaceI srf); 36 | /** get surface 37 | */ 38 | public ISurfaceI surface(); 39 | 40 | 41 | public ITrimCurve get(); 42 | 43 | /** get trim curve in 3d space mapped via the surface */ 44 | public ICurveGeo get3d(); 45 | 46 | // get3() ? 47 | 48 | /** it returns uv coordinates. */ 49 | public IVec2I pt2(double u); 50 | /** alias */ // should this be deleted? 51 | public IVec2I pt2d(double u); 52 | 53 | /** it returns uv coordinates. */ 54 | public IVec2I pt2(IDoubleI u); 55 | /** alias */ // should this be deleted? 56 | public IVec2I pt2d(IDoubleI u); 57 | 58 | public IVec2I start2(); 59 | /** alias */ // should this be deleted? 60 | public IVec2I start2d(); 61 | 62 | public IVec2I end2(); 63 | /** alias */ // should this be deleted? 64 | public IVec2I end2d(); 65 | 66 | public IVec2I startCP2(); 67 | /** alias */ // should this be deleted? 68 | public IVec2I startCP2d(); 69 | 70 | public IVec2I endCP2(); 71 | /** alias */ // should this be deleted? 72 | public IVec2I endCP2d(); 73 | 74 | public ITrimCurveI rev(); 75 | 76 | } 77 | -------------------------------------------------------------------------------- /gui/IGraphicsJ2D.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | import java.awt.*; 26 | import java.util.ArrayList; 27 | 28 | import igeo.IG; 29 | import igeo.IGraphicI; 30 | import igeo.IColor; 31 | import igeo.gui.IGraphicMode; 32 | 33 | /** 34 | Class of Graphics to draw 3D geometry (OpenGL or P3D) 35 | @author Satoru Sugihara 36 | */ 37 | public class IGraphicsJ2D implements IGraphics2D{ 38 | 39 | // J2D 40 | // point 41 | //public void drawPoint(IVec2 p); 42 | // line 43 | //public void drawLines(IVec2[] p); 44 | //public void drawLines(IVec2[] p); 45 | // bezier 46 | // polygon 47 | // surface? 48 | 49 | // stroke colorp 50 | 51 | public IView view; 52 | public boolean firstDraw=true; 53 | 54 | public IGraphicMode.GraphicType type(){ return IGraphicMode.GraphicType.J2D; } 55 | 56 | public IView view(){ return view; } 57 | 58 | public void draw(ArrayList objects, IView v){ 59 | view = v; // current view 60 | } 61 | 62 | public void clr(IColor c){} 63 | public void clr(float[] rgba){} 64 | public void clr(float r, float g, float b, float a){} 65 | public void clr(float r, float g, float b){} 66 | public void stroke(IColor c){} 67 | public void stroke(float[] rgba){} 68 | public void stroke(float r, float g, float b, float a){} 69 | public void stroke(float r, float g, float b){} 70 | public void weight(float w){} 71 | 72 | public boolean firstDraw(){ return firstDraw; } 73 | public void firstDraw(boolean f){ firstDraw=f; } 74 | } 75 | -------------------------------------------------------------------------------- /IUStripeShiftMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | A subclass of IMap defined by another map and parameter shift in u direction in a stripe way in v direction 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IUStripeShiftMap extends IMap{ 33 | public ArrayList domains; 34 | public ArrayList shiftAmounts; 35 | 36 | public IMap origMap; 37 | public IUStripeShiftMap(IMap originalMap){ 38 | origMap = originalMap; 39 | domains = new ArrayList(); 40 | shiftAmounts = new ArrayList(); 41 | } 42 | 43 | public IUStripeShiftMap(IMap originalMap, double shift){ 44 | origMap = originalMap; 45 | domains = new ArrayList(); 46 | shiftAmounts = new ArrayList(); 47 | addShift(0,shift); 48 | addShift(1,shift); 49 | } 50 | 51 | public void addShift(double domain, double shiftAmount){ 52 | domains.add(domain); 53 | shiftAmounts.add(shiftAmount); 54 | } 55 | 56 | public double get(double u, double v){ 57 | double ushift=getShift(v); 58 | if(u+ushift<0) return origMap.get(0,v); 59 | if(u+ushift>1) return origMap.get(1,v); 60 | return origMap.get(u+ushift,v); 61 | } 62 | 63 | public double getShift(double x){ 64 | for(int i=0; i=domains.get(i) && x=domains.get(i+1)) 69 | return shiftAmounts.get(i+1); 70 | } 71 | return 0; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /IVStripeShiftMap.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | A subclass of IMap defined by another map and parameter shift in v direction in a stripe way in u direction 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IVStripeShiftMap extends IMap{ 33 | public ArrayList domains; 34 | public ArrayList shiftAmounts; 35 | 36 | public IMap origMap; 37 | public IVStripeShiftMap(IMap originalMap){ 38 | origMap = originalMap; 39 | domains = new ArrayList(); 40 | shiftAmounts = new ArrayList(); 41 | } 42 | 43 | public IVStripeShiftMap(IMap originalMap, double shift){ 44 | origMap = originalMap; 45 | domains = new ArrayList(); 46 | shiftAmounts = new ArrayList(); 47 | addShift(0,shift); 48 | addShift(1,shift); 49 | } 50 | 51 | public void addShift(double domain, double shiftAmount){ 52 | domains.add(domain); 53 | shiftAmounts.add(shiftAmount); 54 | } 55 | 56 | public double get(double u, double v){ 57 | double vshift=getShift(u); 58 | if(v+vshift<0) return origMap.get(u,0); 59 | if(v+vshift>1) return origMap.get(u,1); 60 | return origMap.get(u,v+vshift); 61 | } 62 | 63 | public double getShift(double x){ 64 | for(int i=0; i=domains.get(i) && x=domains.get(i+1)) 69 | return shiftAmounts.get(i+1); 70 | } 71 | return 0; 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /gui/IKeyEvent.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | import java.awt.*; 26 | import java.awt.event.*; 27 | 28 | /** 29 | Abstracted key event in case no AWT provided 30 | 31 | @author Satoru Sugihara 32 | */ 33 | public class IKeyEvent{ 34 | 35 | public char character; 36 | public int keyCode; 37 | public int keyLocation; 38 | public boolean actionKey; 39 | public boolean altDown, controlDown, metaDown, shiftDown; 40 | 41 | public IKeyEvent(){} 42 | public IKeyEvent(int keycode){ keyCode = keycode; } 43 | public IKeyEvent(KeyEvent e){ 44 | character = e.getKeyChar(); 45 | keyCode = e.getKeyCode(); 46 | keyLocation = e.getKeyLocation(); 47 | actionKey = e.isActionKey(); 48 | altDown = e.isAltDown(); 49 | controlDown = e.isControlDown(); 50 | metaDown = e.isMetaDown(); 51 | shiftDown = e.isShiftDown(); 52 | } 53 | 54 | // doesn't compile in processing 1.5 55 | public IKeyEvent(processing.event.KeyEvent e){ 56 | character = e.getKey(); 57 | keyCode = e.getKeyCode(); 58 | //keyLocation = e.getKeyLocation(); 59 | //actionKey = e.isActionKey(); 60 | altDown = e.isAltDown(); 61 | controlDown = e.isControlDown(); 62 | metaDown = e.isMetaDown(); 63 | shiftDown = e.isShiftDown(); 64 | } 65 | 66 | public char getKeyChar(){ return character; } 67 | public int getKeyCode(){ return keyCode; } 68 | public int getKeyLocation(){ return keyLocation; } 69 | public boolean isAltDown(){ return altDown; } 70 | public boolean isControlDown(){ return controlDown; } 71 | public boolean isMetaDown(){ return metaDown; } 72 | public boolean isShiftDown(){ return shiftDown; } 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /ILineAgent.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Class of an agent with a line with start and end points. 27 | @author Satoru Sugihara 28 | */ 29 | 30 | public class ILineAgent extends IAgent{ 31 | 32 | public ILineAgentGeo line; 33 | 34 | /** current position, i.e. end point of line */ 35 | public IVec pos(){ return line.pos; } 36 | /** alias of pos() */ 37 | public IVec end(){ return pos(); } 38 | /** alias of pos() */ 39 | public IVec pt2(){ return pos(); } 40 | 41 | /** previous position, i.e. start/root point of line */ 42 | public IVec root(){ return line.root; } 43 | /** alias of root() */ 44 | public IVec start(){ return root(); } 45 | /** alias of root() */ 46 | public IVec prevPos(){ return root(); } 47 | /** alias of root() */ 48 | public IVec pt1(){ return root(); } 49 | 50 | /** direction from root to pos */ 51 | public IVec dir(){ return line.dir(); } 52 | /** alias of dir()*/ 53 | public IVec dif(){ return dir(); } 54 | 55 | 56 | public ILineAgent(IVec rootPos, IVec lineDir){ 57 | super(); 58 | line = new ILineAgentGeo(rootPos, lineDir); 59 | addDynamics(line); 60 | } 61 | 62 | public ILineAgent(IVec rootPos){ 63 | this(rootPos, new IVec(0,1,0)); // default dir 64 | } 65 | 66 | public ILineAgent(){ 67 | this(new IVec(0,0,0), new IVec(0,1,0)); // default pos, default dir 68 | } 69 | 70 | public ICurve line(){ return line.line(); } 71 | 72 | public ILineAgent hide(){ line.hide(); return this; } 73 | public ILineAgent show(){ line.show(); return this; } 74 | 75 | 76 | } 77 | 78 | -------------------------------------------------------------------------------- /gui/IBrepGraphicGL.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo.gui; 24 | 25 | import java.util.ArrayList; 26 | //import java.awt.Color; 27 | 28 | import igeo.*; 29 | 30 | /** 31 | Graphic subobject class to draw a surface object by OpenGL. 32 | It contains ISurfaceGraphicFillGL and ISurfaceGraphicWireframeGL inside. 33 | 34 | @author Satoru Sugihara 35 | */ 36 | public class IBrepGraphicGL extends IGraphicObject{ 37 | 38 | public ISurfaceGraphicGL[] surfaceGraphics; 39 | 40 | public IBrepGraphicGL(IBrep brep){ 41 | super(brep); 42 | surfaceGraphics = new ISurfaceGraphicGL[brep.surfaces.length]; 43 | synchronized(this){ 44 | for(int i=0; i. 20 | 21 | ---*/ 22 | 23 | package igeo.io; 24 | 25 | import java.io.*; 26 | import java.util.ArrayList; 27 | 28 | /** 29 | Byte Output Stream keeping byte framgents as fragments never integrating into one buffer 30 | 31 | @author Satoru Sugihara 32 | */ 33 | public class IByteListOutputStream extends OutputStream{ 34 | ArrayList bytes; 35 | public void write(byte[] b){ 36 | if(bytes==null) bytes = new ArrayList(); 37 | bytes.add(b); 38 | } 39 | public void write(byte[] b, int off, int len){ 40 | if(bytes==null) bytes = new ArrayList(); 41 | // this method is not efficient because this duplicates memory 42 | byte[] buf = new byte[len]; 43 | for(int i=0; i(); 48 | byte[] buf = new byte[4]; 49 | for(int d=0; d>>=8; } 50 | bytes.add(buf); 51 | } 52 | public void write(ArrayList b){ 53 | if(bytes==null) bytes = new ArrayList(); 54 | bytes.addAll(b); 55 | } 56 | 57 | public ArrayList toByteList(){ return bytes; } 58 | 59 | 60 | public byte[] toByteArray(){ 61 | int len = length(); 62 | byte[] buf = new byte[len]; 63 | for(int i=0, idx=0; i. 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by a NURBS curve position (vector from the origin). 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class ICurvePositionField extends I3DField{ 32 | public ICurvePositionField(ICurveI crv){ super(new ICurvePositionFieldGeo(crv)); } 33 | static public class ICurvePositionFieldGeo extends ICurveFieldGeo{ 34 | public ICurvePositionFieldGeo(ICurveI crv){ super(crv,crv); } 35 | } 36 | 37 | public ICurvePositionField noDecay(){ super.noDecay(); return this; } 38 | public ICurvePositionField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 39 | public ICurvePositionField linear(double threshold){ super.linear(threshold); return this; } 40 | public ICurvePositionField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 41 | public ICurvePositionField gaussian(double threshold){ super.gaussian(threshold); return this; } 42 | public ICurvePositionField gauss(double threshold){ super.gauss(threshold); return this; } 43 | public ICurvePositionField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 44 | public ICurvePositionField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 45 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 46 | public ICurvePositionField bidirectional(boolean b){ super.bidirectional(b); return this; } 47 | 48 | public ICurvePositionField threshold(double t){ super.threshold(t); return this; } 49 | public ICurvePositionField intensity(double i){ super.intensity(i); return this; } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /IMeshNormalField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by normal vector of mesh vertices 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class IMeshNormalField extends I3DField{ 32 | public IMeshNormalField(IMeshI m){ super(new IMeshNormalFieldGeo(m)); } 33 | public static class IMeshNormalFieldGeo extends IMeshFieldGeo{ 34 | public IMeshNormalFieldGeo(IMeshI m){ super(m); } 35 | public IVecI get(int vertexIndex){ 36 | return mesh.vertex(vertexIndex).nml(); 37 | } 38 | } 39 | 40 | public IMeshNormalField noDecay(){ super.noDecay(); return this; } 41 | public IMeshNormalField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 42 | public IMeshNormalField linear(double threshold){ super.linear(threshold); return this; } 43 | public IMeshNormalField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 44 | public IMeshNormalField gaussian(double threshold){ super.gaussian(threshold); return this; } 45 | public IMeshNormalField gauss(double threshold){ super.gauss(threshold); return this; } 46 | public IMeshNormalField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 47 | public IMeshNormalField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 48 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 49 | public IMeshNormalField bidirectional(boolean b){ super.bidirectional(b); return this; } 50 | 51 | public IMeshNormalField threshold(double t){ super.threshold(t); return this; } 52 | public IMeshNormalField intensity(double i){ super.intensity(i); return this; } 53 | } 54 | -------------------------------------------------------------------------------- /IRadialComparator.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | A class to define order of IVec in angle around a specified center to be used in sorting with ISort. 27 | 28 | @see ISort 29 | 30 | @author Satoru Sugihara 31 | */ 32 | public class IRadialComparator implements IComparator{ 33 | public IVec center = new IVec(0,0,0); 34 | public IVec normal = new IVec(0,0,1); 35 | public IVec startDir = new IVec(1,0,0); 36 | 37 | public IRadialComparator(){} 38 | public IRadialComparator(IVec center){ this.center = center; } 39 | public IRadialComparator(IVec center, IVec normal){ 40 | this.center = center; this.normal = normal; 41 | double a = startDir.angle(normal); 42 | if(a < IConfig.angleTolerance || 43 | Math.abs(Math.abs(a)-Math.PI) < IConfig.angleTolerance ){ 44 | startDir = normal.cross(new IVec(0,0,1)).cross(normal); 45 | } 46 | else{ startDir = normal.cross(startDir).cross(normal); } 47 | } 48 | public IRadialComparator(IVec center, IVec normal, IVec startDir){ 49 | this.center = center; this.normal = normal; this.startDir=startDir; 50 | if( Math.abs(Math.abs(startDir.angle(normal)) - Math.PI/2) >= 51 | IConfig.angleTolerance){ 52 | startDir = normal.cross(startDir.dup()).cross(normal); 53 | } 54 | } 55 | 56 | public double angle(IVec v){ 57 | double a = startDir.angle(normal.cross(v.diff(center)).cross(normal), normal); 58 | if(a<0){ a += Math.PI*2; } // angle() returns -Math.PI to +Math.PI. 59 | return a; 60 | } 61 | 62 | public int compare(IVec v1, IVec v2){ // return >0, <0, ==0 63 | double a1 = angle(v1); 64 | double a2 = angle(v2); 65 | if(a1 < a2) return -1; 66 | if(a1 > a2) return 1; 67 | return 0; 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /ICurveTangentField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by a NURBS curve tanget. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class ICurveTangentField extends I3DField{ 32 | public ICurveTangentField(ICurveI crv){ super(new ICurveTangentFieldGeo(crv)); } 33 | static public class ICurveTangentFieldGeo extends ICurveFieldGeo{ 34 | public ICurveTangentFieldGeo(ICurveI crv){ super(crv,crv); } 35 | public IVecI get(IVecI v, double u){ return fieldCurve.tan(u); } 36 | } 37 | 38 | public ICurveTangentField noDecay(){ super.noDecay(); return this; } 39 | public ICurveTangentField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 40 | public ICurveTangentField linear(double threshold){ super.linear(threshold); return this; } 41 | public ICurveTangentField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 42 | public ICurveTangentField gaussian(double threshold){ super.gaussian(threshold); return this; } 43 | public ICurveTangentField gauss(double threshold){ super.gauss(threshold); return this; } 44 | public ICurveTangentField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 45 | public ICurveTangentField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 46 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 47 | public ICurveTangentField bidirectional(boolean b){ super.bidirectional(b); return this; } 48 | 49 | public ICurveTangentField threshold(double t){ super.threshold(t); return this; } 50 | public ICurveTangentField intensity(double i){ super.intensity(i); return this; } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /ILinkedScalarAgent.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Agent class with a generic data with links to other data agents 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class ILinkedScalarAgent extends ILinkedDataAgent{ 31 | 32 | public ILinkedScalarAgent(){ super(); } 33 | public ILinkedScalarAgent(IDoubleI val){ super(val); } 34 | public ILinkedScalarAgent(IVecI pos){ super(pos); } 35 | public ILinkedScalarAgent(IVecI pos, IDoubleI val){ super(pos,val); } 36 | // public ILinkedScalarAgent(IObject parent){ super(parent); } 37 | // public ILinkedScalarAgent(IDoubleI val, IObject parent){ super(val,parent); } 38 | 39 | 40 | /************************************** 41 | * static method 42 | *************************************/ 43 | 44 | public static ILinkedScalarAgent[] create(IMeshI m){ 45 | ILinkedScalarAgent[] agents = new ILinkedScalarAgent[m.vertexNum()]; 46 | for(int i=0; i=0 && idx2>=0){ 61 | agents[idx1].connect(agents[idx2]); 62 | agents[idx2].connect(agents[idx1]); 63 | } 64 | } 65 | return agents; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /ISurfacePositionField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by a NURBS surface position (vector from the origin). 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class ISurfacePositionField extends I3DField{ 32 | public ISurfacePositionField(ISurfaceI srf){ super(new ISurfacePositionFieldGeo(srf)); } 33 | static public class ISurfacePositionFieldGeo extends ISurfaceFieldGeo{ 34 | public ISurfacePositionFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | } 36 | 37 | public ISurfacePositionField noDecay(){ super.noDecay(); return this; } 38 | public ISurfacePositionField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 39 | public ISurfacePositionField linear(double threshold){ super.linear(threshold); return this; } 40 | public ISurfacePositionField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 41 | public ISurfacePositionField gaussian(double threshold){ super.gaussian(threshold); return this; } 42 | public ISurfacePositionField gauss(double threshold){ super.gauss(threshold); return this; } 43 | public ISurfacePositionField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 44 | public ISurfacePositionField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 45 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 46 | public ISurfacePositionField bidirectional(boolean b){ super.bidirectional(b); return this; } 47 | 48 | public ISurfacePositionField threshold(double t){ super.threshold(t); return this; } 49 | public ISurfacePositionField intensity(double i){ super.intensity(i); return this; } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /I2DSurfacePositionField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 2D vector filed defined by a NURBS surface position (vector from the origin). 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class I2DSurfacePositionField extends I2DField{ 32 | public I2DSurfacePositionField(ISurfaceI srf){ super(new I2DSurfacePositionFieldGeo(srf)); } 33 | static public class I2DSurfacePositionFieldGeo extends I2DSurfaceFieldGeo{ 34 | public I2DSurfacePositionFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | } 36 | public I2DSurfacePositionField noDecay(){ super.noDecay(); return this; } 37 | public I2DSurfacePositionField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 38 | public I2DSurfacePositionField linear(double threshold){ super.linear(threshold); return this; } 39 | public I2DSurfacePositionField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 40 | public I2DSurfacePositionField gaussian(double threshold){ super.gaussian(threshold); return this; } 41 | public I2DSurfacePositionField gauss(double threshold){ super.gauss(threshold); return this; } 42 | public I2DSurfacePositionField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 43 | public I2DSurfacePositionField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 44 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 45 | public I2DSurfacePositionField bidirectional(boolean b){ super.bidirectional(b); return this; } 46 | 47 | public I2DSurfacePositionField threshold(double t){ super.threshold(t); return this; } 48 | public I2DSurfacePositionField intensity(double i){ super.intensity(i); return this; } 49 | } 50 | -------------------------------------------------------------------------------- /IPlanarAttractor.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D field attracting only on the planar direction. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class IPlanarAttractor extends I3DField{ 32 | public IPlanarAttractor(IVecI pos, IVecI planeDir){ super(new IPlanarAttractorGeo(pos,planeDir)); } 33 | static public class IPlanarAttractorGeo extends IPointFieldGeo{ 34 | public IPlanarAttractorGeo(IVecI pos, IVecI planeDir){ super(pos,planeDir); } 35 | public IVecI getForce(IVecI v, IVecI orig){ return orig.get().dif(v).projectToPlane(dir); } 36 | } 37 | 38 | public IPlanarAttractor noDecay(){ super.noDecay(); return this; } 39 | public IPlanarAttractor linearDecay(double threshold){ super.linearDecay(threshold); return this; } 40 | public IPlanarAttractor linear(double threshold){ super.linear(threshold); return this; } 41 | public IPlanarAttractor gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 42 | public IPlanarAttractor gaussian(double threshold){ super.gaussian(threshold); return this; } 43 | public IPlanarAttractor gauss(double threshold){ super.gauss(threshold); return this; } 44 | public IPlanarAttractor decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 45 | public IPlanarAttractor constantIntensity(boolean b){ super.constantIntensity(b); return this; } 46 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 47 | public IPlanarAttractor bidirectional(boolean b){ super.bidirectional(b); return this; } 48 | 49 | public IPlanarAttractor threshold(double t){ super.threshold(t); return this; } 50 | public IPlanarAttractor intensity(double i){ super.intensity(i); return this; } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /ISurfaceNormalField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by a NURBS surface normal. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class ISurfaceNormalField extends I3DField{ 32 | public ISurfaceNormalField(ISurfaceI srf){ super(new ISurfaceNormalFieldGeo(srf)); } 33 | static public class ISurfaceNormalFieldGeo extends ISurfaceFieldGeo{ 34 | public ISurfaceNormalFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | public IVecI get(IVecI v, IVec2I uv){ return fieldSurface.nml(uv); } 36 | } 37 | 38 | public ISurfaceNormalField noDecay(){ super.noDecay(); return this; } 39 | public ISurfaceNormalField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 40 | public ISurfaceNormalField linear(double threshold){ super.linear(threshold); return this; } 41 | public ISurfaceNormalField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 42 | public ISurfaceNormalField gaussian(double threshold){ super.gaussian(threshold); return this; } 43 | public ISurfaceNormalField gauss(double threshold){ super.gauss(threshold); return this; } 44 | public ISurfaceNormalField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 45 | public ISurfaceNormalField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 46 | 47 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 48 | public ISurfaceNormalField bidirectional(boolean b){ super.bidirectional(b); return this; } 49 | 50 | public ISurfaceNormalField threshold(double t){ super.threshold(t); return this; } 51 | public ISurfaceNormalField intensity(double i){ super.intensity(i); return this; } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /I2DSurfaceNormalField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 2D vector filed defined by a NURBS surface normal. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class I2DSurfaceNormalField extends I2DField{ 32 | public I2DSurfaceNormalField(ISurfaceI srf){ super(new I2DSurfaceNormalField(srf)); } 33 | public static class I2DSurfaceNormalFieldGeo extends I2DSurfaceFieldGeo{ 34 | public I2DSurfaceNormalFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | public IVec2I get(IVecI v, IVec2I uv){ return fieldSurface.nml(uv).to2d(); } 36 | } 37 | public I2DSurfaceNormalField noDecay(){ super.noDecay(); return this; } 38 | public I2DSurfaceNormalField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 39 | public I2DSurfaceNormalField linear(double threshold){ super.linear(threshold); return this; } 40 | public I2DSurfaceNormalField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 41 | public I2DSurfaceNormalField gaussian(double threshold){ super.gaussian(threshold); return this; } 42 | public I2DSurfaceNormalField gauss(double threshold){ super.gauss(threshold); return this; } 43 | public I2DSurfaceNormalField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 44 | public I2DSurfaceNormalField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 45 | 46 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 47 | public I2DSurfaceNormalField bidirectional(boolean b){ super.bidirectional(b); return this; } 48 | 49 | public I2DSurfaceNormalField threshold(double t){ super.threshold(t); return this; } 50 | public I2DSurfaceNormalField intensity(double i){ super.intensity(i); return this; } 51 | } 52 | -------------------------------------------------------------------------------- /ICurveAttractorField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | import java.util.ArrayList; 26 | 27 | /** 28 | 3D vector filed defined by a NURBS curve. 29 | 30 | @author Satoru Sugihara 31 | */ 32 | 33 | public class ICurveAttractorField extends I3DField{ 34 | public ICurveAttractorField(ICurveI crv){ super(new ICurveAttractorFieldGeo(crv)); } 35 | static public class ICurveAttractorFieldGeo extends ICurveFieldGeo{ 36 | public ICurveAttractorFieldGeo(ICurveI crv){ super(crv,crv); } 37 | public IVecI get(IVecI v, double u){ return fieldCurve.pt(u).sub(v); } 38 | } 39 | 40 | public ICurveAttractorField noDecay(){ super.noDecay(); return this; } 41 | public ICurveAttractorField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 42 | public ICurveAttractorField linear(double threshold){ super.linear(threshold); return this; } 43 | public ICurveAttractorField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 44 | public ICurveAttractorField gaussian(double threshold){ super.gaussian(threshold); return this; } 45 | public ICurveAttractorField gauss(double threshold){ super.gauss(threshold); return this; } 46 | public ICurveAttractorField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 47 | public ICurveAttractorField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 48 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 49 | public ICurveAttractorField bidirectional(boolean b){ super.bidirectional(b); return this; } 50 | 51 | public ICurveAttractorField threshold(double t){ super.threshold(t); return this; } 52 | public ICurveAttractorField intensity(double i){ super.intensity(i); return this; } 53 | } 54 | -------------------------------------------------------------------------------- /ISurfaceUTangentField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by a NURBS surface tangent in U. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class ISurfaceUTangentField extends I3DField{ 32 | public ISurfaceUTangentField(ISurfaceI srf){ super(new ISurfaceUTangentFieldGeo(srf)); } 33 | public static class ISurfaceUTangentFieldGeo extends ISurfaceFieldGeo{ 34 | public ISurfaceUTangentFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | public IVecI get(IVecI v, IVec2I uv){ return fieldSurface.utan(uv); } 36 | } 37 | 38 | public ISurfaceUTangentField noDecay(){ super.noDecay(); return this; } 39 | public ISurfaceUTangentField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 40 | public ISurfaceUTangentField linear(double threshold){ super.linear(threshold); return this; } 41 | public ISurfaceUTangentField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 42 | public ISurfaceUTangentField gaussian(double threshold){ super.gaussian(threshold); return this; } 43 | public ISurfaceUTangentField gauss(double threshold){ super.gauss(threshold); return this; } 44 | public ISurfaceUTangentField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 45 | public ISurfaceUTangentField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 46 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 47 | public ISurfaceUTangentField bidirectional(boolean b){ super.bidirectional(b); return this; } 48 | 49 | public ISurfaceUTangentField threshold(double t){ super.threshold(t); return this; } 50 | public ISurfaceUTangentField intensity(double i){ super.intensity(i); return this; } 51 | } 52 | -------------------------------------------------------------------------------- /ISurfaceVTangentField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by a NURBS surface tangent in U. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class ISurfaceVTangentField extends I3DField{ 32 | public ISurfaceVTangentField(ISurfaceI srf){ super(new ISurfaceVTangentFieldGeo(srf)); } 33 | static public class ISurfaceVTangentFieldGeo extends ISurfaceFieldGeo{ 34 | public ISurfaceVTangentFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | public IVecI get(IVecI v, IVec2I uv){ return fieldSurface.vtan(uv); } 36 | } 37 | 38 | public ISurfaceVTangentField noDecay(){ super.noDecay(); return this; } 39 | public ISurfaceVTangentField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 40 | public ISurfaceVTangentField linear(double threshold){ super.linear(threshold); return this; } 41 | public ISurfaceVTangentField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 42 | public ISurfaceVTangentField gaussian(double threshold){ super.gaussian(threshold); return this; } 43 | public ISurfaceVTangentField gauss(double threshold){ super.gauss(threshold); return this; } 44 | public ISurfaceVTangentField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 45 | public ISurfaceVTangentField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 46 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 47 | public ISurfaceVTangentField bidirectional(boolean b){ super.bidirectional(b); return this; } 48 | 49 | public ISurfaceVTangentField threshold(double t){ super.threshold(t); return this; } 50 | public ISurfaceVTangentField intensity(double i){ super.intensity(i); return this; } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /ICurveCurlField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by a NURBS curve tanget causing curling force. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class ICurveCurlField extends I3DField{ 32 | public ICurveCurlField(ICurveI crv){ super(new ICurveCurlFieldGeo(crv)); } 33 | static public class ICurveCurlFieldGeo extends ICurveFieldGeo{ 34 | public ICurveCurlFieldGeo(ICurveI crv){ super(crv,crv); } 35 | public IVecI get(IVecI v, double u){ 36 | //return fieldCurve.tan(u).get().icross(fieldCurve.pt(u).sub(v)); 37 | return fieldCurve.pt(u).get().sub(v).icross(fieldCurve.tan(u)); 38 | } 39 | } 40 | 41 | public ICurveCurlField noDecay(){ super.noDecay(); return this; } 42 | public ICurveCurlField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 43 | public ICurveCurlField linear(double threshold){ super.linear(threshold); return this; } 44 | public ICurveCurlField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 45 | public ICurveCurlField gaussian(double threshold){ super.gaussian(threshold); return this; } 46 | public ICurveCurlField gauss(double threshold){ super.gauss(threshold); return this; } 47 | public ICurveCurlField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 48 | public ICurveCurlField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 49 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 50 | public ICurveCurlField bidirectional(boolean b){ super.bidirectional(b); return this; } 51 | 52 | public ICurveCurlField threshold(double t){ super.threshold(t); return this; } 53 | public ICurveCurlField intensity(double i){ super.intensity(i); return this; } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /IMatrixI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Abstract interface of numerical matrix. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IMatrixI extends IMatrixOp{ 31 | 32 | //public IMatrix get(); 33 | 34 | public IMatrixI dup(); 35 | /** alias of dup() */ 36 | public IMatrixI cp(); 37 | 38 | public int rowNum(); 39 | public int columnNum(); 40 | //public IIntegerI rowNumR(); 41 | //public IIntegerI columnNumR(); 42 | public int rowNum(ISwitchE e); 43 | public int columnNum(ISwitchE e); 44 | public IIntegerI rowNum(ISwitchR r); 45 | public IIntegerI columnNum(ISwitchR r); 46 | 47 | public IMatrixI setZero(); 48 | public IMatrixI setId(); 49 | 50 | public double get(int row, int column); 51 | //public IDoubleI getR(IIntegerI row, IIntegerI column); 52 | public double get(ISwitchE e, int row, int column); 53 | public IDoubleI get(ISwitchR r, IIntegerI row, IIntegerI column); 54 | 55 | public IMatrixI set(double[][] v); 56 | public IMatrixI set(IDoubleI[][] v); 57 | 58 | public IMatrix set(int row, int column, double value); 59 | public IMatrix set(IIntegerI row, IIntegerI column, IDoubleI value); 60 | 61 | public IMatrixI set(IMatrixI m); 62 | 63 | public IMatrixI add(IMatrixI m); 64 | public IMatrixI sub(IMatrixI m); 65 | 66 | public IMatrixI div(double v); 67 | public IMatrixI div(IDoubleI v); 68 | 69 | public IMatrixI mul(double v); 70 | public IMatrixI mul(IDoubleI v); 71 | 72 | public IMatrixI mul(IMatrixI m); 73 | 74 | 75 | public double determinant(); 76 | //public IDoubleI determinantR(); 77 | public double determinant(ISwitchE e); 78 | public IDoubleI determinant(ISwitchR r); 79 | 80 | public IMatrixI invert(); 81 | 82 | } 83 | -------------------------------------------------------------------------------- /I2DSurfaceUTangentField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 2D vector filed defined by a NURBS surface tangent in U. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class I2DSurfaceUTangentField extends I2DField{ 32 | public I2DSurfaceUTangentField(ISurfaceI srf){ super(new I2DSurfaceUTangentFieldGeo(srf)); } 33 | static public class I2DSurfaceUTangentFieldGeo extends I2DSurfaceFieldGeo{ 34 | public I2DSurfaceUTangentFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | public IVec2I get(IVecI v, IVec2I uv){ return fieldSurface.utan(uv).to2d(); } 36 | } 37 | 38 | public I2DSurfaceUTangentField noDecay(){ super.noDecay(); return this; } 39 | public I2DSurfaceUTangentField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 40 | public I2DSurfaceUTangentField linear(double threshold){ super.linear(threshold); return this; } 41 | public I2DSurfaceUTangentField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 42 | public I2DSurfaceUTangentField gaussian(double threshold){ super.gaussian(threshold); return this; } 43 | public I2DSurfaceUTangentField gauss(double threshold){ super.gauss(threshold); return this; } 44 | public I2DSurfaceUTangentField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 45 | public I2DSurfaceUTangentField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 46 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 47 | public I2DSurfaceUTangentField bidirectional(boolean b){ super.bidirectional(b); return this; } 48 | 49 | public I2DSurfaceUTangentField threshold(double t){ super.threshold(t); return this; } 50 | public I2DSurfaceUTangentField intensity(double i){ super.intensity(i); return this; } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /I2DSurfaceVTangentField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 2D vector filed defined by a NURBS surface tangent in U. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class I2DSurfaceVTangentField extends I2DField{ 32 | public I2DSurfaceVTangentField(ISurfaceI srf){ super(new I2DSurfaceVTangentFieldGeo(srf)); } 33 | static public class I2DSurfaceVTangentFieldGeo extends I2DSurfaceFieldGeo{ 34 | public I2DSurfaceVTangentFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | public IVec2I get(IVecI v, IVec2I uv){ return fieldSurface.vtan(uv).to2d(); } 36 | } 37 | 38 | public I2DSurfaceVTangentField noDecay(){ super.noDecay(); return this; } 39 | public I2DSurfaceVTangentField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 40 | public I2DSurfaceVTangentField linear(double threshold){ super.linear(threshold); return this; } 41 | public I2DSurfaceVTangentField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 42 | public I2DSurfaceVTangentField gaussian(double threshold){ super.gaussian(threshold); return this; } 43 | public I2DSurfaceVTangentField gauss(double threshold){ super.gauss(threshold); return this; } 44 | public I2DSurfaceVTangentField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 45 | public I2DSurfaceVTangentField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 46 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 47 | public I2DSurfaceVTangentField bidirectional(boolean b){ super.bidirectional(b); return this; } 48 | 49 | public I2DSurfaceVTangentField threshold(double t){ super.threshold(t); return this; } 50 | public I2DSurfaceVTangentField intensity(double i){ super.intensity(i); return this; } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /ISurfaceAttractorField.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | 3D vector filed defined by a NURBS surface to attract particle to the closest point on the surface. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | 31 | public class ISurfaceAttractorField extends I3DField{ 32 | public ISurfaceAttractorField(ISurfaceI srf){ super(new ISurfaceAttractorFieldGeo(srf)); } 33 | static public class ISurfaceAttractorFieldGeo extends ISurfaceFieldGeo{ 34 | public ISurfaceAttractorFieldGeo(ISurfaceI srf){ super(srf,srf); } 35 | public IVecI get(IVecI pos, IVec2I uv){ 36 | return fieldSurface.pt(uv).sub(pos); 37 | } 38 | } 39 | 40 | public ISurfaceAttractorField noDecay(){ super.noDecay(); return this; } 41 | public ISurfaceAttractorField linearDecay(double threshold){ super.linearDecay(threshold); return this; } 42 | public ISurfaceAttractorField linear(double threshold){ super.linear(threshold); return this; } 43 | public ISurfaceAttractorField gaussianDecay(double threshold){ super.gaussianDecay(threshold); return this; } 44 | public ISurfaceAttractorField gaussian(double threshold){ super.gaussian(threshold); return this; } 45 | public ISurfaceAttractorField gauss(double threshold){ super.gauss(threshold); return this; } 46 | public ISurfaceAttractorField decay(IDecay decay, double threshold){ super.decay(decay,threshold); return this; } 47 | public ISurfaceAttractorField constantIntensity(boolean b){ super.constantIntensity(b); return this; } 48 | 49 | /** if bidirectional is on, field force vector is flipped when velocity of particle is going opposite */ 50 | public ISurfaceAttractorField bidirectional(boolean b){ super.bidirectional(b); return this; } 51 | 52 | public ISurfaceAttractorField threshold(double t){ super.threshold(t); return this; } 53 | public ISurfaceAttractorField intensity(double i){ super.intensity(i); return this; } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /IIntegerI.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Interface of integer to be used as IParameterObject. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public interface IIntegerI extends IIntegerOp{ 31 | /** 32 | @return Primitive value. 33 | */ 34 | public int x(); 35 | 36 | /** 37 | @return Fixed value but in wrapper class. 38 | */ 39 | public IInteger get(); 40 | 41 | /** 42 | @return Generic parameter of the value (either of entity class or reference class). 43 | */ 44 | public IIntegerI getX(); 45 | 46 | /** 47 | @return Duplicated instance. 48 | */ 49 | public IIntegerI dup(); 50 | 51 | /** alias of dup() */ 52 | public IIntegerI cp(); 53 | 54 | /** duplicate and add */ 55 | public IIntegerI cp(int v); 56 | 57 | /** duplicate and add */ 58 | public IIntegerI cp(IIntegerI v); 59 | 60 | /** 61 | convert reference tree to one constant value 62 | */ 63 | //public IIntegerI const(); 64 | 65 | public IIntegerI set(IIntegerI v); 66 | public IIntegerI set(int v); 67 | 68 | public IIntegerI set(double v); 69 | public IIntegerI set(IDoubleI v); 70 | 71 | public IIntegerI add(IIntegerI v); 72 | public IIntegerI add(int v); 73 | public IIntegerI sub(IIntegerI v); 74 | public IIntegerI sub(int v); 75 | public IIntegerI mul(IIntegerI v); 76 | public IIntegerI mul(int v); 77 | public IIntegerI div(IIntegerI v); 78 | public IIntegerI div(int v); 79 | public IIntegerI neg(); 80 | 81 | public IIntegerI mod(IIntegerI v); 82 | public IIntegerI mod(int v); 83 | 84 | public boolean eq(int v); 85 | public boolean eq(IIntegerI v); 86 | //public IBoolI eqR(IIntegerI v); 87 | public boolean eq(ISwitchE e, IIntegerI v); 88 | public IBoolI eq(ISwitchR r, IIntegerI v); 89 | 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /IBool.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Entity class of boolean to be used as IParameterObject. 27 | 28 | @author Satoru Sugihara 29 | */ 30 | public class IBool extends IParameterObject implements IBoolI, IEntityParameter{ 31 | public boolean x; 32 | 33 | /** 34 | default constructor doesn't instantiate parent IGElement 35 | */ 36 | public IBool(){} 37 | public IBool(boolean i){ x=i; } 38 | public IBool(IBool i){ x=i.x; } 39 | public IBool(IBoolI i){ x=i.x(); } 40 | 41 | /** 42 | constructor with IServerI instantiates parent IGElement 43 | */ 44 | public IBool(IServerI s){ super(s); } 45 | public IBool(IServerI s, boolean i){ super(s);x=i; } 46 | public IBool(IServerI s, IBool i){ super(s);x=i.x; } 47 | public IBool(IServerI s, IBoolI i){ super(s);x=i.x(); } 48 | 49 | public boolean x(){ return x; } 50 | //public IBool get(){ return this; } 51 | public IBool get(){ return new IBool(x); } 52 | public IBool getX(){ return this; } 53 | public IBool dup(){ return new IBool(x); } 54 | public IBool cp(){ return dup(); } 55 | 56 | public IBool set(IBoolI v){ x=v.x(); return this; } 57 | public IBool set(IBool v){ x=v.x; return this; } 58 | public IBool set(boolean v){ x=v; return this; } 59 | 60 | public IBool and(IBoolI v){ x&=v.x(); return this; } 61 | public IBool and(IBool v){ x&=v.x; return this; } 62 | public IBool and(boolean v){ x&=v; return this; } 63 | public IBool or(IBoolI v){ x|=v.x(); return this; } 64 | public IBool or(IBool v){ x|=v.x; return this; } 65 | public IBool or(boolean v){ x&=v; return this; } 66 | public IBool not(){ x=!x; return this; } 67 | 68 | public boolean eq(IBoolI v){ return x==v.x(); } 69 | //public IBool eqR(IBoolI v){ return new IBool(eq(v)); } 70 | public boolean eq(ISwitchE e, IBoolI v){ return eq(v); } 71 | public IBool eq(ISwitchR r, IBoolI v){ return new IBool(eq(v)); } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /ILineAgentGeo.java: -------------------------------------------------------------------------------- 1 | /*--- 2 | 3 | iGeo - http://igeo.jp 4 | 5 | Copyright (c) 2002-2013 Satoru Sugihara 6 | 7 | This file is part of iGeo. 8 | 9 | iGeo is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as 11 | published by the Free Software Foundation, version 3. 12 | 13 | iGeo is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with iGeo. If not, see . 20 | 21 | ---*/ 22 | 23 | package igeo; 24 | 25 | /** 26 | Class of an agent with a line with start and end points. 27 | @author Satoru Sugihara 28 | */ 29 | 30 | public class ILineAgentGeo extends IDynamicsBase{ 31 | 32 | /** end point of line */ 33 | public IVec pos; 34 | /** start point of line */ 35 | public IVec root; 36 | 37 | public ICurve line; 38 | 39 | /** current position, i.e. end point of line */ 40 | public IVec pos(){ return pos; } 41 | /** alias of pos() */ 42 | public IVec end(){ return pos(); } 43 | /** alias of pos() */ 44 | public IVec pt2(){ return pos(); } 45 | 46 | /** previous position, i.e. start/root point of line */ 47 | public IVec root(){ return root; } 48 | /** alias of root() */ 49 | public IVec start(){ return root(); } 50 | /** alias of root() */ 51 | public IVec prevPos(){ return root(); } 52 | /** alias of root() */ 53 | public IVec pt1(){ return root(); } 54 | 55 | /** direction from root to pos */ 56 | public IVec dir(){ return pos.dif(root); } 57 | /** alias of dir()*/ 58 | public IVec dif(){ return dir(); } 59 | 60 | 61 | public ILineAgentGeo(IVec rootPos, IVec lineDir){ 62 | root = rootPos; 63 | pos = rootPos.cp(lineDir); 64 | } 65 | 66 | public ILineAgentGeo(IVec rootPos){ 67 | this(rootPos, new IVec(0,1,0)); // default dir 68 | } 69 | 70 | public ILineAgentGeo(){ 71 | this(new IVec(0,0,0), new IVec(0,1,0)); // default pos, default dir 72 | } 73 | 74 | public ICurve drawLine(){ 75 | ICurve l = new ICurve(root, pos); 76 | if(parent()!=null && parent().attr()!=null) l.attr(parent().attr()); 77 | return l; 78 | } 79 | 80 | public ICurve line(){ return line; } 81 | 82 | public void hide(){ line.hide(); } 83 | public void show(){ line.show(); } 84 | 85 | public void update(){ 86 | if(line==null){ // should be in the first time 87 | line = drawLine(); 88 | } 89 | } 90 | 91 | } 92 | 93 | --------------------------------------------------------------------------------