mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
added warnings back in
This commit is contained in:
parent
30eb581f28
commit
fd8068d905
@ -12,14 +12,15 @@
|
|||||||
// written consent of Walt Disney Imagineering Inc.
|
// written consent of Walt Disney Imagineering Inc.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "nurbsCurve.h"
|
#include "nurbsCurve.h"
|
||||||
|
#include "config_parametrics.h"
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Statics
|
// Statics
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TypeHandle NurbsCurve::_type_handle;
|
TypeHandle NurbsCurve::_type_handle;
|
||||||
|
|
||||||
static const LVector3f zero = LVector3f(0.0, 0.0, 0.0);
|
static const LVector3f zero = LVector3f(0.0, 0.0, 0.0);
|
||||||
// This is returned occasionally from some of the functions, and is
|
// This is returned occasionally from some of the functions, and is
|
||||||
// used from time to time as an initializer.
|
// used from time to time as an initializer.
|
||||||
@ -60,9 +61,9 @@ NurbsCurve(const ParametricCurve &pc) {
|
|||||||
_order = 4;
|
_order = 4;
|
||||||
|
|
||||||
if (!pc.convert_to_nurbs(*this)) {
|
if (!pc.convert_to_nurbs(*this)) {
|
||||||
///DWARNING(dnparametrics)
|
parametrics_cat->warning()
|
||||||
///<< "Cannot make a NURBS from the indicated curve."
|
<< "Cannot make a NURBS from the indicated curve."
|
||||||
///<< dnend;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,13 +102,13 @@ NurbsCurve(int order, int num_cvs,
|
|||||||
void NurbsCurve::
|
void NurbsCurve::
|
||||||
set_order(int order) {
|
set_order(int order) {
|
||||||
if (order < 1 || order > 4) {
|
if (order < 1 || order > 4) {
|
||||||
///DWARNING(dnparametrics)
|
parametrics_cat->warning()
|
||||||
///<< "Invalid NURBS curve order: " << order << dnend;
|
<< "Invalid NURBS curve order: " << order << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!_cvs.empty()) {
|
if (!_cvs.empty()) {
|
||||||
///DWARNING(dnparametrics)
|
parametrics_cat->warning()
|
||||||
///<< "Cannot change NURBS curve order on a nonempty curve." << dnend;
|
<< "Cannot change NURBS curve order on a nonempty curve." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_order = order;
|
_order = order;
|
||||||
@ -614,7 +615,7 @@ rebuild_curveseg(int rtype0, double t0, const LVector4f &v0,
|
|||||||
// Figure out which CV's contributed to this segment.
|
// Figure out which CV's contributed to this segment.
|
||||||
int seg = 0;
|
int seg = 0;
|
||||||
|
|
||||||
///dnassert(_cvs.size() > _order-1);
|
nassertr(_cvs.size() > _order-1, false);
|
||||||
|
|
||||||
int cv = 0;
|
int cv = 0;
|
||||||
for (cv = 0; cv < _cvs.size()-(_order-1); cv++) {
|
for (cv = 0; cv < _cvs.size()-(_order-1); cv++) {
|
||||||
@ -752,16 +753,16 @@ write_egg(ostream &out, const char *basename) {
|
|||||||
void NurbsCurve::
|
void NurbsCurve::
|
||||||
splice(double t, const NurbsCurve &other) {
|
splice(double t, const NurbsCurve &other) {
|
||||||
if (other._order != _order) {
|
if (other._order != _order) {
|
||||||
///DWARNING(dnparametrics)
|
parametrics_cat->warning()
|
||||||
///<< "Cannot splice NURBS curves of different orders!" << dnend;
|
<< "Cannot splice NURBS curves of different orders!" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double old_t = get_max_t();
|
double old_t = get_max_t();
|
||||||
|
|
||||||
if (t < old_t) {
|
if (t < old_t) {
|
||||||
///DWARNING(dnparametrics)
|
parametrics_cat->warning()
|
||||||
///<< "Invalid splicing in the middle of a curve!" << dnend;
|
<< "Invalid splicing in the middle of a curve!" << endl;
|
||||||
t = old_t;
|
t = old_t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user