001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.7 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * {@link CubicBezier} representation for {@link RenderCurve} objects and {@link Polygon} objects. 013 <p> 014 * The {@link RenderCubicBezier} is derived from {@link RenderPoint} and is the second element needed to 015 * represent arbitrary curves with relative coordinates as they can appear in RenderCurves 016 * and {@link Polygon} objects. 017 * In addition to the attributes inherited from {@link RenderPoint}, {@link RenderCubicBezier} has two additional 018 * attributes for the two base points that define a cubic bezier curve. 019 <p> 020 * Segments in a {@link RenderCurve} or a {@link Polygon} are always defined by two consecutive {@link RenderPoint} or 021 * {@link RenderCubicBezier} elements. The first element in a list of RenderPoints has to be a {@link RenderPoint} 022 * object, all following elements can either be RenderPoints or {@link RenderCubicBezier} elements. 023 * If the second element is a {@link RenderPoint}, the two elements represent a straight line segement, 024 * if the second element if a {@link RenderCubicBezier}, the two elements represent a cubic bezier curve 025 * segment. 026 <p> 027 * For further details please have a look at the SBML render extension specification. 028 */ 029 030public class RenderCubicBezier extends RenderPoint { 031 private long swigCPtr; 032 033 protected RenderCubicBezier(long cPtr, boolean cMemoryOwn) 034 { 035 super(libsbmlJNI.RenderCubicBezier_SWIGUpcast(cPtr), cMemoryOwn); 036 swigCPtr = cPtr; 037 } 038 039 protected static long getCPtr(RenderCubicBezier obj) 040 { 041 return (obj == null) ? 0 : obj.swigCPtr; 042 } 043 044 protected static long getCPtrAndDisown (RenderCubicBezier obj) 045 { 046 long ptr = 0; 047 048 if (obj != null) 049 { 050 ptr = obj.swigCPtr; 051 obj.swigCMemOwn = false; 052 } 053 054 return ptr; 055 } 056 057 protected void finalize() { 058 delete(); 059 } 060 061 public synchronized void delete() { 062 if (swigCPtr != 0) { 063 if (swigCMemOwn) { 064 swigCMemOwn = false; 065 libsbmlJNI.delete_RenderCubicBezier(swigCPtr); 066 } 067 swigCPtr = 0; 068 } 069 super.delete(); 070 } 071 072 073/** 074 * Creates a new {@link RenderCubicBezier} object with the given SBML level 075 * and SBML version. 076 <p> 077 * @param level SBML level of the new object 078 * @param level SBML version of the new object 079 */ public 080 RenderCubicBezier(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 081 this(libsbmlJNI.new_RenderCubicBezier__SWIG_0(level, version, pkgVersion), true); 082 } 083 084 085/** 086 * Creates a new {@link RenderCubicBezier} object with the given SBML level 087 * and SBML version. 088 <p> 089 * @param level SBML level of the new object 090 * @param level SBML version of the new object 091 */ public 092 RenderCubicBezier(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 093 this(libsbmlJNI.new_RenderCubicBezier__SWIG_1(level, version), true); 094 } 095 096 097/** 098 * Creates a new {@link RenderCubicBezier} object with the given SBML level 099 * and SBML version. 100 <p> 101 * @param level SBML level of the new object 102 * @param level SBML version of the new object 103 */ public 104 RenderCubicBezier(long level) throws org.sbml.libsbml.SBMLConstructorException { 105 this(libsbmlJNI.new_RenderCubicBezier__SWIG_2(level), true); 106 } 107 108 109/** 110 * Creates a new {@link RenderCubicBezier} object with the given SBML level 111 * and SBML version. 112 <p> 113 * @param level SBML level of the new object 114 * @param level SBML version of the new object 115 */ public 116 RenderCubicBezier() throws org.sbml.libsbml.SBMLConstructorException { 117 this(libsbmlJNI.new_RenderCubicBezier__SWIG_3(), true); 118 } 119 120 121/** 122 * Creates a new {@link RenderCubicBezier} object with the given {@link SBMLNamespaces}. 123 <p> 124 * @param sbmlns The SBML namespace for the object. 125 */ public 126 RenderCubicBezier(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException { 127 this(libsbmlJNI.new_RenderCubicBezier__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true); 128 } 129 130 131/** 132 * Copy constructor for {@link RenderCubicBezier} objects. 133 */ public 134 RenderCubicBezier(RenderCubicBezier orig) throws org.sbml.libsbml.SBMLConstructorException { 135 this(libsbmlJNI.new_RenderCubicBezier__SWIG_5(RenderCubicBezier.getCPtr(orig), orig), true); 136 } 137 138 139/** 140 * Creates a {@link CubicBezier} with the given points. 141 <p> 142 * @param bp1_x x coordinatee of the first base point. 143 * @param bp1_y y coordinatee of the first base point. 144 * @param bp1_z z coordinatee of the first base point. 145 * @param bp1_x x coordinatee of the second base point. 146 * @param bp1_y y coordinatee of the second base point. 147 * @param bp1_z z coordinatee of the second base point. 148 * @param bp1_x x coordinatee of the end point. 149 * @param bp1_y y coordinatee of the end point. 150 * @param bp1_z z coordinatee of the end point. 151 */ public 152 RenderCubicBezier(RenderPkgNamespaces renderns, RelAbsVector bp1_x, RelAbsVector bp1_y, RelAbsVector bp1_z, RelAbsVector bp2_x, RelAbsVector bp2_y, RelAbsVector bp2_z, RelAbsVector end_x, RelAbsVector end_y, RelAbsVector end_z) throws org.sbml.libsbml.SBMLConstructorException { 153 this(libsbmlJNI.new_RenderCubicBezier__SWIG_6(RenderPkgNamespaces.getCPtr(renderns), renderns, RelAbsVector.getCPtr(bp1_x), bp1_x, RelAbsVector.getCPtr(bp1_y), bp1_y, RelAbsVector.getCPtr(bp1_z), bp1_z, RelAbsVector.getCPtr(bp2_x), bp2_x, RelAbsVector.getCPtr(bp2_y), bp2_y, RelAbsVector.getCPtr(bp2_z), bp2_z, RelAbsVector.getCPtr(end_x), end_x, RelAbsVector.getCPtr(end_y), end_y, RelAbsVector.getCPtr(end_z), end_z), true); 154 } 155 156 157/** 158 * Creates a new {@link RenderCubicBezier} object from the given {@link XMLNode} object. 159 * The {@link XMLNode} object has to contain a valid XML representation of a 160 * {@link RenderCubicBezier} object as defined in the render extension specification. 161 * This method is normally called when render information is read from a file and 162 * should normally not have to be called explicitly. 163 <p> 164 * @param node the {@link XMLNode} object reference that describes the {@link RenderCubicBezier} 165 * object to be instantiated. 166 */ public 167 RenderCubicBezier(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 168 this(libsbmlJNI.new_RenderCubicBezier__SWIG_7(XMLNode.getCPtr(node), node, l2version), true); 169 } 170 171 172/** 173 * Creates a new {@link RenderCubicBezier} object from the given {@link XMLNode} object. 174 * The {@link XMLNode} object has to contain a valid XML representation of a 175 * {@link RenderCubicBezier} object as defined in the render extension specification. 176 * This method is normally called when render information is read from a file and 177 * should normally not have to be called explicitly. 178 <p> 179 * @param node the {@link XMLNode} object reference that describes the {@link RenderCubicBezier} 180 * object to be instantiated. 181 */ public 182 RenderCubicBezier(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 183 this(libsbmlJNI.new_RenderCubicBezier__SWIG_8(XMLNode.getCPtr(node), node), true); 184 } 185 186 187/** 188 * Returns the x value of the first base point of the curve (the one closer to the 189 * starting point) as a reference. 190 <p> 191 * @return reference to x value of first base point 192 */ public 193 RelAbsVector basePoint1_X() { 194 return new RelAbsVector(libsbmlJNI.RenderCubicBezier_basePoint1_X__SWIG_0(swigCPtr, this), false); 195 } 196 197 198/** 199 * Returns the y value of the first base point of the curve (the one closer to the 200 * starting point) as a reference. 201 <p> 202 * @return reference to y value of first base point 203 */ public 204 RelAbsVector basePoint1_Y() { 205 return new RelAbsVector(libsbmlJNI.RenderCubicBezier_basePoint1_Y__SWIG_0(swigCPtr, this), false); 206 } 207 208 209/** 210 * Returns the z value of the first base point of the curve (the one closer to the 211 * starting point) as a reference. 212 <p> 213 * @return reference to z value of first base point 214 */ public 215 RelAbsVector basePoint1_Z() { 216 return new RelAbsVector(libsbmlJNI.RenderCubicBezier_basePoint1_Z__SWIG_0(swigCPtr, this), false); 217 } 218 219 220/** 221 * Returns the x value of the second base point of the curve (the one further from the 222 * starting point) as a reference. 223 <p> 224 * @return reference to x value of second base point 225 */ public 226 RelAbsVector basePoint2_X() { 227 return new RelAbsVector(libsbmlJNI.RenderCubicBezier_basePoint2_X__SWIG_0(swigCPtr, this), false); 228 } 229 230 231/** 232 * Returns the y value of the second base point of the curve (the one further from the 233 * starting point) as a reference. 234 <p> 235 * @return reference to y value of second base point 236 */ public 237 RelAbsVector basePoint2_Y() { 238 return new RelAbsVector(libsbmlJNI.RenderCubicBezier_basePoint2_Y__SWIG_0(swigCPtr, this), false); 239 } 240 241 242/** 243 * Returns the z value of the second base point of the curve (the one further from the 244 * starting point) as a reference. 245 <p> 246 * @return reference to z value of second base point 247 */ public 248 RelAbsVector basePoint2_Z() { 249 return new RelAbsVector(libsbmlJNI.RenderCubicBezier_basePoint2_Z__SWIG_0(swigCPtr, this), false); 250 } 251 252 253/** 254 * Sets the x value of the first base point of the curve (the one closer to the 255 * starting point). 256 <p> 257 * @param x x coordinate of first base point. 258 */ public 259 void setBasePoint1_X(RelAbsVector x) { 260 libsbmlJNI.RenderCubicBezier_setBasePoint1_X(swigCPtr, this, RelAbsVector.getCPtr(x), x); 261 } 262 263 264/** 265 * Sets the y value of the first base point of the curve (the one closer to the 266 * starting point). 267 <p> 268 * @param y y coordinate of first base point. 269 */ public 270 void setBasePoint1_Y(RelAbsVector y) { 271 libsbmlJNI.RenderCubicBezier_setBasePoint1_Y(swigCPtr, this, RelAbsVector.getCPtr(y), y); 272 } 273 274 275/** 276 * Sets the z value of the first base point of the curve (the one closer to the 277 * starting point). 278 <p> 279 * @param z z coordinate of first base point. 280 */ public 281 void setBasePoint1_Z(RelAbsVector z) { 282 libsbmlJNI.RenderCubicBezier_setBasePoint1_Z(swigCPtr, this, RelAbsVector.getCPtr(z), z); 283 } 284 285 286/** 287 * Sets the x value of the second base point of the curve (the one further from the 288 * starting point). 289 <p> 290 * @param x value of second base point. 291 */ public 292 void setBasePoint2_X(RelAbsVector x) { 293 libsbmlJNI.RenderCubicBezier_setBasePoint2_X(swigCPtr, this, RelAbsVector.getCPtr(x), x); 294 } 295 296 297/** 298 * Sets the y value of the second base point of the curve (the one further from the 299 * starting point). 300 <p> 301 * @param y value of second base point. 302 */ public 303 void setBasePoint2_Y(RelAbsVector y) { 304 libsbmlJNI.RenderCubicBezier_setBasePoint2_Y(swigCPtr, this, RelAbsVector.getCPtr(y), y); 305 } 306 307 308/** 309 * Sets the z value of the second base point of the curve (the one further from the 310 * starting point). 311 <p> 312 * @param z value of second base point. 313 */ public 314 void setBasePoint2_Z(RelAbsVector z) { 315 libsbmlJNI.RenderCubicBezier_setBasePoint2_Z(swigCPtr, this, RelAbsVector.getCPtr(z), z); 316 } 317 318 319/** 320 * Sets the first basepoint to the given coordinatees. 321 <p> 322 * @param x coordinate of second base point. 323 * @param y coordinate of second base point. 324 * @param z coordinate of second base point. 325 * If the z coodinate is omitted, it is set to 0. 326 */ public 327 void setBasePoint1(RelAbsVector x, RelAbsVector y, RelAbsVector z) { 328 libsbmlJNI.RenderCubicBezier_setBasePoint1__SWIG_0(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(z), z); 329 } 330 331 332/** 333 * Sets the first basepoint to the given coordinatees. 334 <p> 335 * @param x coordinate of second base point. 336 * @param y coordinate of second base point. 337 * @param z coordinate of second base point. 338 * If the z coodinate is omitted, it is set to 0. 339 */ public 340 void setBasePoint1(RelAbsVector x, RelAbsVector y) { 341 libsbmlJNI.RenderCubicBezier_setBasePoint1__SWIG_1(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y); 342 } 343 344 345/** 346 * Sets the second basepoint to the given coordinatees. 347 <p> 348 * @param x coordinate of second base point. 349 * @param y coordinate of second base point. 350 * @param z coordinate of second base point. 351 * If the z coodinate is omitted, it is set to 0. 352 */ public 353 void setBasePoint2(RelAbsVector x, RelAbsVector y, RelAbsVector z) { 354 libsbmlJNI.RenderCubicBezier_setBasePoint2__SWIG_0(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y, RelAbsVector.getCPtr(z), z); 355 } 356 357 358/** 359 * Sets the second basepoint to the given coordinatees. 360 <p> 361 * @param x coordinate of second base point. 362 * @param y coordinate of second base point. 363 * @param z coordinate of second base point. 364 * If the z coodinate is omitted, it is set to 0. 365 */ public 366 void setBasePoint2(RelAbsVector x, RelAbsVector y) { 367 libsbmlJNI.RenderCubicBezier_setBasePoint2__SWIG_1(swigCPtr, this, RelAbsVector.getCPtr(x), x, RelAbsVector.getCPtr(y), y); 368 } 369 370 371/** 372 * Returns the XML element name of this object, which for 373 * {@link RenderCubicBezier}, is always <code>'element'.</code> 374 <p> 375 * @return the name of this element, i.e., <code>'element'.</code> 376 */ public 377 String getElementName() { 378 return libsbmlJNI.RenderCubicBezier_getElementName(swigCPtr, this); 379 } 380 381 382/** 383 * Creates and returns a deep copy of the {@link RenderCubicBezier} object. 384 <p> 385 * @return a (deep) copy of this {@link RenderCubicBezier} 386 */ public 387 RenderCubicBezier cloneObject() { 388 long cPtr = libsbmlJNI.RenderCubicBezier_cloneObject(swigCPtr, this); 389 return (cPtr == 0) ? null : new RenderCubicBezier(cPtr, true); 390 } 391 392 393/** 394 * Returns the libSBML type code for the objects contained in this {@link ListOf} 395 * (i.e., {@link ColorDefinition} objects, if the list is non-empty). 396 <p> 397 * LibSBML attaches an 398 * identifying code to every kind of SBML object. These are known as 399 * <em>SBML type codes</em>. In other languages, the set of type codes 400 * is stored in an enumeration; in the Java language interface for 401 * libSBML, the type codes are defined as static integer constants in 402 * interface class {@link libsbmlConstants}. The names of the type codes 403 * all begin with the characters <code>SBML_.</code> 404 <p> 405 * @return the SBML type code for the objects contained in this {@link ListOf} 406 * instance, or <code>SBML_UNKNOWN</code> (default). 407 <p> 408 * @see #getElementName() 409 */ public 410 int getTypeCode() { 411 return libsbmlJNI.RenderCubicBezier_getTypeCode(swigCPtr, this); 412 } 413 414 415/** 416 * Creates an {@link XMLNode} object from this {@link RenderCubicBezier} object. 417 <p> 418 * @return the {@link XMLNode} with the XML representation for the 419 * {@link RenderCubicBezier} object. 420 */ public 421 XMLNode toXML(String name) { 422 return new XMLNode(libsbmlJNI.RenderCubicBezier_toXML(swigCPtr, this, name), true); 423 } 424 425 426/** * @internal */ public 427 boolean hasRequiredAttributes() { 428 return libsbmlJNI.RenderCubicBezier_hasRequiredAttributes(swigCPtr, this); 429 } 430 431 432/** * @internal */ public 433 boolean hasRequiredElements() { 434 return libsbmlJNI.RenderCubicBezier_hasRequiredElements(swigCPtr, this); 435 } 436 437}