Skip to content
Snippets Groups Projects
Commit 1445868e authored by Shon Ferguson's avatar Shon Ferguson
Browse files

Removed SWIG-related junk from Niflib and removed any reference to Python in the documentation.

Updated user's guide.
parent 84b9aa2e
No related branches found
No related tags found
No related merge requests found
Showing
with 8 additions and 288 deletions
...@@ -21,8 +21,6 @@ struct Key { ...@@ -21,8 +21,6 @@ struct Key {
float continuity; /*!< The amount of continuity to use in tension, bias, continuity interpolation. Ignored if key type is something else.*/ float continuity; /*!< The amount of continuity to use in tension, bias, continuity interpolation. Ignored if key type is something else.*/
}; };
//These operators cause SWIG warnings
#ifndef SWIG
template <class T> template <class T>
ostream & operator<<( ostream & out, Key<T> const & val ) { ostream & operator<<( ostream & out, Key<T> const & val ) {
return out << "Time: " << val.time << endl return out << "Time: " << val.time << endl
...@@ -32,7 +30,6 @@ ostream & operator<<( ostream & out, Key<T> const & val ) { ...@@ -32,7 +30,6 @@ ostream & operator<<( ostream & out, Key<T> const & val ) {
<< "Bias: " << val.bias << endl << "Bias: " << val.bias << endl
<< "Continuity: " << val.continuity << endl; << "Continuity: " << val.continuity << endl;
} }
#endif
} }
#endif #endif
...@@ -19,194 +19,6 @@ using namespace std; ...@@ -19,194 +19,6 @@ using namespace std;
#define NULL 0 #define NULL 0
#endif #endif
///*!
// * Class overridable alloc/release methods
// * \param T Type of array
// */
//template<typename T>
//class array_Traits
//{
//public:
// /*!
// * Default Initialization method.
// * \param v Vector of types to initialize
// * \param length Length in bytes of memory to allocate
// */
// static void Initialize( T* v, int length ) {
// memset(v, 0, sizeof(v[0]) * length);
// }
// /*!
// * Default Finalization method.
// * \param v Vector of types to initialize
// * \param length Length in bytes of memory to allocate
// */
// static void Finalize( T* v, int length ) {
// memset(v, 0, sizeof(v[0]) * length);
// }
// /*
// * Default Initialization method.
// * \param s Vector of types to copy from
// * \param d Vector of types to copy to
// * \param length Length in bytes of memory to allocate
// */
// static void Copy(T const* s, T* d, int length ) {
// for (int i=0; i<length; ++i)
// d[i] = s[i];
// }
//};
//
///*!
// * A fixed length array of type T.
// * Data is allocated into a array portion and the data section.
// * The array simply points to appropriate places in the data section.
// * \param T Type of array
// * \param len_ Size of the array.
// */
//template<size_t len_, typename T>
//class array
//{
// typedef typename T * RawData;
// typedef typename T const* ConstRawData;
//public:
// /*!
// *Default Constructor. Allocates empty array.
// */
// array() {
// array_Traits<T>::Initialize(v_, len_);
// }
//
// /*!
// * Copy constructor.
// * \param other The array being copied
// */
// array(const array& other) {
// array_Traits<T>::Copy(other.v_, v_, len_);
// }
//
// /*!
// * Copy constructor.
// * \param other The array being copied
// */
// array(const RawData& other) {
// array_Traits<T>::Copy(other, v_, len_);
// }
//
// /*!
// * Copy constructor.
// * \param other The array being copied
// */
// array(RawData& other) {
// array_Traits<T>::Copy(other, v_, len_);
// }
//
// /*!
// * Default destructor.
// */
// ~array() {
// array_Traits<T>::Finalize(v_, len_);
// }
//
// //These operators cause SWIG warnings
// #ifndef SWIG
//
// /*
// * Copy assignment.
// * \param The array to assign to this one.
// * \return A reference to this array.
// */
// array& operator=(const array& other) {
// array tmp( other );
// swap( tmp );
// return *this;
// }
//
// /*
// * Copy assignment.
// * \param The array to assign to this one.
// * \return A reference to this array.
// */
// array& operator=(const ConstRawData& other) {
// array tmp( other );
// swap( tmp );
// return *this;
// }
//
// T& operator[](int index) {
// // assert( index >= 0 && index < len_ )
// return v_[index];
// }
//
// const T& operator[](int index) const {
// // assert( index >= 0 && index < len_ )
// return v_[index];
// }
//
// T& operator[](unsigned int index) {
// // assert( index >= 0 && index < len_ )
// return v_[index];
// }
//
// const T& operator[](unsigned int index) const {
// // assert( index >= 0 && index < len_ )
// return v_[index];
// }
//
//#endif
// operator T*() const {
// return v_;
// }
//
// /*! Number of items in the vector. */
// size_t size() const { return len_; }
// size_t count() const { return len_; }
//
// T* begin() {
// return v_;
// }
//
// T* end() {
// return v_ + len_;
// }
//
// const T* begin() const {
// return v_;
// }
//
// const T* end() const {
// return v_ + len_;
// }
//
// /*!
// * Assign an element to array at specified index.
// * \param index Index in array to assign.
// * \param value Value to copy into string.
// */
// void assign(int index, T value) {
// v_[index] = value;
// }
//
// /*!
// * Resets array back to zero size.
// */
// void clear() {
// array_Traits<T>::Finalize(v_, len_);
// }
//
// /*!
// * Swap contents with another array.
// * \param other Other vector to swap with
// */
// void swap( array &other ) {
// array tmp(other);
// array_Traits<T>::Copy(v_, other.v_, len_);
// array_Traits<T>::Copy(tmp.v_, v_, len_);
// }
//
//private:
//
// T v_[len_]; //! Vector data
//};
/*! Used to enable static arrays to be members of vectors */ /*! Used to enable static arrays to be members of vectors */
template<int size, class T> template<int size, class T>
struct array { struct array {
......
...@@ -44,20 +44,12 @@ public: ...@@ -44,20 +44,12 @@ public:
bool operator==(const Ref & ref) const; bool operator==(const Ref & ref) const;
bool operator!=(const Ref & ref) const; bool operator!=(const Ref & ref) const;
//These operators generate problems in SWIG
#ifndef SWIG
friend ostream & operator<< <T>(ostream & os, const Ref & ref); friend ostream & operator<< <T>(ostream & os, const Ref & ref);
Ref & operator=( T * object ); Ref & operator=( T * object );
Ref & operator=( const Ref & ref ); Ref & operator=( const Ref & ref );
operator T*() const; operator T*() const;
#endif
T* operator->() const; T* operator->() const;
//SWIG specific operators
string __str__();
string __repr__();
T* __call__() const;
protected: protected:
#ifdef USE_NIFLIB_TEMPLATE_HELPERS #ifdef USE_NIFLIB_TEMPLATE_HELPERS
template<typename U> friend class Ref; template<typename U> friend class Ref;
...@@ -103,9 +95,6 @@ T* Ref<T>::operator->() const { ...@@ -103,9 +95,6 @@ T* Ref<T>::operator->() const {
return _object; return _object;
} }
//These operators generate warnings in SWIG
#ifndef SWIG
template <class T> template <class T>
T& Ref<T>::operator*() const { T& Ref<T>::operator*() const {
return *_object; return *_object;
...@@ -157,7 +146,6 @@ Ref<T> & Ref<T>::operator=( const Ref & ref ) { ...@@ -157,7 +146,6 @@ Ref<T> & Ref<T>::operator=( const Ref & ref ) {
return *this; return *this;
} }
#endif
//Template functions must be in the header file //Template functions must be in the header file
...@@ -190,7 +178,6 @@ bool Ref<T>::operator!=(const Ref & ref) const { ...@@ -190,7 +178,6 @@ bool Ref<T>::operator!=(const Ref & ref) const {
return ( _object != ref._object ); return ( _object != ref._object );
} }
#ifndef SWIG
template <class T> template <class T>
ostream & operator<<(ostream & os, const Ref<T> & ref) { ostream & operator<<(ostream & os, const Ref<T> & ref) {
if (ref._object) { if (ref._object) {
...@@ -200,34 +187,7 @@ ostream & operator<<(ostream & os, const Ref<T> & ref) { ...@@ -200,34 +187,7 @@ ostream & operator<<(ostream & os, const Ref<T> & ref) {
} }
return os; return os;
} }
#endif
//SWIG functions
template <class T>
string Ref<T>::__str__() {
if (_object) {
return _object->asString();
} else {
return string("None");
}
} }
template <class T>
string Ref<T>::__repr__() {
if (_object) {
return _object->GetIDString();
} else {
return string("None");
}
}
template <class T>
T* Ref<T>::__call__() const {
return _object;
}
}
#endif #endif
...@@ -11,29 +11,28 @@ All rights reserved. Please see niflib.h for license. */ ...@@ -11,29 +11,28 @@ All rights reserved. Please see niflib.h for license. */
# endif # endif
#endif #endif
// shared library: expose NIFLIB_API objects, hide NIFLIB_HIDDEN objects
#ifndef NIFLIB_STATIC_LINK #ifndef NIFLIB_STATIC_LINK
// building swig wrapper // Building shared library
#if defined(SWIG) #if defined(_WIN32) || defined(__WIN32__) || defined(_MSC_VER) || defined(__CYGWIN__)
#define NIFLIB_API // Windows
#define NIFLIB_HIDDEN
// building shared library (windows)
#elif defined(_WIN32) || defined(__WIN32__) || defined(_MSC_VER) || defined(__CYGWIN__)
#ifdef BUILDING_NIFLIB_DLL #ifdef BUILDING_NIFLIB_DLL
//The building process is underway, export symbols
#define NIFLIB_API __declspec(dllexport) #define NIFLIB_API __declspec(dllexport)
#else #else
//Header files are being used to import symbols from a previously built library
#define NIFLIB_API __declspec(dllimport) #define NIFLIB_API __declspec(dllimport)
#endif #endif
#define NIFLIB_HIDDEN #define NIFLIB_HIDDEN
// building shared library (linux)
#elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) #elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
// Linux (GCC)
#define NIFLIB_API __attribute__ ((visibility("default"))) #define NIFLIB_API __attribute__ ((visibility("default")))
#define NIFLIB_HIDDEN __attribute__ ((visibility("hidden"))) #define NIFLIB_HIDDEN __attribute__ ((visibility("hidden")))
#else #else
#error __attribute__ ((visibility("hidden"))) support required, but not detected (see gcc.gnu.org/wiki/Visibility) #error __attribute__ ((visibility("hidden"))) support required, but not detected (see gcc.gnu.org/wiki/Visibility)
#endif #endif
// static library: nothing to hide
#else #else
// Building static library
#define NIFLIB_API #define NIFLIB_API
#define NIFLIB_HIDDEN #define NIFLIB_HIDDEN
#endif #endif
......
...@@ -25,11 +25,8 @@ struct AVObject { ...@@ -25,11 +25,8 @@ struct AVObject {
NIFLIB_API ~AVObject(); NIFLIB_API ~AVObject();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API AVObject( const AVObject & src ); NIFLIB_API AVObject( const AVObject & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API AVObject & operator=( const AVObject & src ); NIFLIB_API AVObject & operator=( const AVObject & src );
#endif
/*! /*!
* Object name. * Object name.
*/ */
......
...@@ -23,11 +23,8 @@ struct BoundingBox { ...@@ -23,11 +23,8 @@ struct BoundingBox {
NIFLIB_API ~BoundingBox(); NIFLIB_API ~BoundingBox();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API BoundingBox( const BoundingBox & src ); NIFLIB_API BoundingBox( const BoundingBox & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API BoundingBox & operator=( const BoundingBox & src ); NIFLIB_API BoundingBox & operator=( const BoundingBox & src );
#endif
/*! /*!
* Usually 1. * Usually 1.
*/ */
......
...@@ -23,11 +23,8 @@ struct ByteArray { ...@@ -23,11 +23,8 @@ struct ByteArray {
NIFLIB_API ~ByteArray(); NIFLIB_API ~ByteArray();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API ByteArray( const ByteArray & src ); NIFLIB_API ByteArray( const ByteArray & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API ByteArray & operator=( const ByteArray & src ); NIFLIB_API ByteArray & operator=( const ByteArray & src );
#endif
/*! /*!
* The number of bytes in this array * The number of bytes in this array
*/ */
......
...@@ -23,11 +23,8 @@ struct ByteColor3 { ...@@ -23,11 +23,8 @@ struct ByteColor3 {
NIFLIB_API ~ByteColor3(); NIFLIB_API ~ByteColor3();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API ByteColor3( const ByteColor3 & src ); NIFLIB_API ByteColor3( const ByteColor3 & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API ByteColor3 & operator=( const ByteColor3 & src ); NIFLIB_API ByteColor3 & operator=( const ByteColor3 & src );
#endif
/*! /*!
* Red color component. * Red color component.
*/ */
......
...@@ -33,11 +33,8 @@ struct ControllerLink { ...@@ -33,11 +33,8 @@ struct ControllerLink {
NIFLIB_API ~ControllerLink(); NIFLIB_API ~ControllerLink();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API ControllerLink( const ControllerLink & src ); NIFLIB_API ControllerLink( const ControllerLink & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API ControllerLink & operator=( const ControllerLink & src ); NIFLIB_API ControllerLink & operator=( const ControllerLink & src );
#endif
/*! /*!
* Name of a controllable object in another NIF file. * Name of a controllable object in another NIF file.
*/ */
......
...@@ -28,11 +28,8 @@ struct Footer { ...@@ -28,11 +28,8 @@ struct Footer {
NIFLIB_API ~Footer(); NIFLIB_API ~Footer();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API Footer( const Footer & src ); NIFLIB_API Footer( const Footer & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API Footer & operator=( const Footer & src ); NIFLIB_API Footer & operator=( const Footer & src );
#endif
/*! /*!
* The number of root references. * The number of root references.
*/ */
......
...@@ -23,11 +23,8 @@ struct FurniturePosition { ...@@ -23,11 +23,8 @@ struct FurniturePosition {
NIFLIB_API ~FurniturePosition(); NIFLIB_API ~FurniturePosition();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API FurniturePosition( const FurniturePosition & src ); NIFLIB_API FurniturePosition( const FurniturePosition & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API FurniturePosition & operator=( const FurniturePosition & src ); NIFLIB_API FurniturePosition & operator=( const FurniturePosition & src );
#endif
/*! /*!
* Offset of furniture marker. * Offset of furniture marker.
*/ */
......
...@@ -24,11 +24,8 @@ struct Header { ...@@ -24,11 +24,8 @@ struct Header {
NIFLIB_API ~Header(); NIFLIB_API ~Header();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API Header( const Header & src ); NIFLIB_API Header( const Header & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API Header & operator=( const Header & src ); NIFLIB_API Header & operator=( const Header & src );
#endif
/*! /*!
* 'NetImmerse File Format x.x.x.x' (versions <= 10.0.1.2) or 'Gamebryo * 'NetImmerse File Format x.x.x.x' (versions <= 10.0.1.2) or 'Gamebryo
* File Format x.x.x.x' (versions >= 10.1.0.0), with x.x.x.x the version * File Format x.x.x.x' (versions >= 10.1.0.0), with x.x.x.x the version
......
...@@ -23,11 +23,8 @@ struct LODRange { ...@@ -23,11 +23,8 @@ struct LODRange {
NIFLIB_API ~LODRange(); NIFLIB_API ~LODRange();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API LODRange( const LODRange & src ); NIFLIB_API LODRange( const LODRange & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API LODRange & operator=( const LODRange & src ); NIFLIB_API LODRange & operator=( const LODRange & src );
#endif
/*! /*!
* Begining of range. * Begining of range.
*/ */
......
...@@ -23,11 +23,8 @@ struct LimitedHingeDescriptor { ...@@ -23,11 +23,8 @@ struct LimitedHingeDescriptor {
NIFLIB_API ~LimitedHingeDescriptor(); NIFLIB_API ~LimitedHingeDescriptor();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API LimitedHingeDescriptor( const LimitedHingeDescriptor & src ); NIFLIB_API LimitedHingeDescriptor( const LimitedHingeDescriptor & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API LimitedHingeDescriptor & operator=( const LimitedHingeDescriptor & src ); NIFLIB_API LimitedHingeDescriptor & operator=( const LimitedHingeDescriptor & src );
#endif
/*! /*!
* Unknown. * Unknown.
*/ */
......
...@@ -23,11 +23,8 @@ struct MatchGroup { ...@@ -23,11 +23,8 @@ struct MatchGroup {
NIFLIB_API ~MatchGroup(); NIFLIB_API ~MatchGroup();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API MatchGroup( const MatchGroup & src ); NIFLIB_API MatchGroup( const MatchGroup & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API MatchGroup & operator=( const MatchGroup & src ); NIFLIB_API MatchGroup & operator=( const MatchGroup & src );
#endif
/*! /*!
* Number of vertices in this group. * Number of vertices in this group.
*/ */
......
...@@ -23,11 +23,8 @@ struct MipMap { ...@@ -23,11 +23,8 @@ struct MipMap {
NIFLIB_API ~MipMap(); NIFLIB_API ~MipMap();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API MipMap( const MipMap & src ); NIFLIB_API MipMap( const MipMap & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API MipMap & operator=( const MipMap & src ); NIFLIB_API MipMap & operator=( const MipMap & src );
#endif
/*! /*!
* Width of the mipmap image. * Width of the mipmap image.
*/ */
......
...@@ -23,11 +23,8 @@ struct Morph { ...@@ -23,11 +23,8 @@ struct Morph {
NIFLIB_API ~Morph(); NIFLIB_API ~Morph();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API Morph( const Morph & src ); NIFLIB_API Morph( const Morph & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API Morph & operator=( const Morph & src ); NIFLIB_API Morph & operator=( const Morph & src );
#endif
/*! /*!
* Name of the frame. * Name of the frame.
*/ */
......
...@@ -25,11 +25,8 @@ struct NodeGroup { ...@@ -25,11 +25,8 @@ struct NodeGroup {
NIFLIB_API ~NodeGroup(); NIFLIB_API ~NodeGroup();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API NodeGroup( const NodeGroup & src ); NIFLIB_API NodeGroup( const NodeGroup & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API NodeGroup & operator=( const NodeGroup & src ); NIFLIB_API NodeGroup & operator=( const NodeGroup & src );
#endif
/*! /*!
* Number of node references that follow. * Number of node references that follow.
*/ */
......
...@@ -23,11 +23,8 @@ struct OblivionColFilter { ...@@ -23,11 +23,8 @@ struct OblivionColFilter {
NIFLIB_API ~OblivionColFilter(); NIFLIB_API ~OblivionColFilter();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API OblivionColFilter( const OblivionColFilter & src ); NIFLIB_API OblivionColFilter( const OblivionColFilter & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API OblivionColFilter & operator=( const OblivionColFilter & src ); NIFLIB_API OblivionColFilter & operator=( const OblivionColFilter & src );
#endif
/*! /*!
* Sets mesh color in Oblivion Construction Set. * Sets mesh color in Oblivion Construction Set.
*/ */
......
...@@ -23,11 +23,8 @@ struct OblivionSubShape { ...@@ -23,11 +23,8 @@ struct OblivionSubShape {
NIFLIB_API ~OblivionSubShape(); NIFLIB_API ~OblivionSubShape();
/*! Copy Constructor */ /*! Copy Constructor */
NIFLIB_API OblivionSubShape( const OblivionSubShape & src ); NIFLIB_API OblivionSubShape( const OblivionSubShape & src );
//This operator give SWIG problems
#ifndef SWIG
/*! Copy Operator */ /*! Copy Operator */
NIFLIB_API OblivionSubShape & operator=( const OblivionSubShape & src ); NIFLIB_API OblivionSubShape & operator=( const OblivionSubShape & src );
#endif
/*! /*!
* Sets mesh color in Oblivion Construction Set. * Sets mesh color in Oblivion Construction Set.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment