<commit_before>#ifndef SRC_MODEL3D_BODYNODE_H
#define SRC_MODEL3D_BODYNODE_H

#include <vector>
using namespace std;
#include <Eigen/Dense>
using namespace Eigen;

#include "bodynode.h"

namespace model3d {
#define MAX_NODE3D_NAME 128

  class Marker;
  class Dof;
  class Transformation;
  class Primitive;
  class Skeleton;
  class Joint;

  class BodyNode {
  public:
    BodyNode(char *_name = NULL);
    ~BodyNode();

    // functions from Node
    void evalR(VectorXd&);
    void init();
    void update(VectorXd&);
    void evalSecondOrder(VectorXd&);
    MatrixXd evalM(VectorXd&);
    VectorXd evalC(VectorXd&);
    VectorXd evalWorldPos(VectorXd h);	// recursive function
    MatrixXd evalDpDq(VectorXd lp);	
    void evalSecDpDq(VectorXd, vector<MatrixXd>&);
    VectorXd evalMomenta(VectorXd,VectorXd);
    MatrixXd evalP(VectorXd);
    MatrixXd evaldLdq(VectorXd, VectorXd);
    double evalG();
    VectorXd evaldGdq();

    inline VectorXd evalCOM();
    void draw();
    inline double getMass();

    // Jie's helper functions
    void evalJC();
    void evalJW();
    void evalJCq(int dofIndex);
    void evalJWq(int dofIndex);

    // ori functions
    // Transformation
    MatrixXd getWorldTransform();
  
    // Inverse Transformation
    MatrixXd getWorldInvTransform();
    MatrixXd getLocalInvTransform();
	
    void draw(Vector4d _color, bool _default, int depth = 0);	// render the entire bodylink subtree rooted here
    void drawHandles(Vector4d _color, bool _default);	// render the handles

    inline char* getName();
    inline Vector3d getOffset();
    inline void setOffset(Vector3d _off);
    inline int getModelIndex();
    inline void setModelIndex(int _idx);
    inline BodyNode* getNodeIn();
    inline void setSkel(Skeleton* skel);

    inline void addHandle(Marker *h);
    inline vector<Marker*> clearHandles();
    inline void removeHandle(Marker *h);
    inline int getNumHandles();
    inline Marker* getHandle(int i);
	
    inline Primitive* getPrimitive();
    inline void setPrimitive(Primitive *_p);

    inline void addJointOut(Joint *_c);
    inline int getNumJoints();
    inline Joint* getJointOut(int i);
    inline Joint* getJointIn();
    inline void setJointIn(Joint *_p);

    // wrapper functions for joints
    inline BodyNode* getNodeOut(int i);
    inline int getNumDofs();
    inline Dof* getDof(int i);
    inline bool isPresent(Dof* q);
    inline Matrix4d getLocalTrans();
    inline Matrix4d getLocalDeriv(Dof* q);<commit_msg>bit alignment problem in VS2010 is fixed: Vector3d -> Vector3d& (Do not pass a large structure by value)<commit_after>#ifndef SRC_MODEL3D_BODYNODE_H
#define SRC_MODEL3D_BODYNODE_H

#include <vector>
using namespace std;
#include <Eigen/Dense>
using namespace Eigen;

#include "bodynode.h"

namespace model3d {
#define MAX_NODE3D_NAME 128

  class Marker;
  class Dof;
  class Transformation;
  class Primitive;
  class Skeleton;
  class Joint;

  class BodyNode {
  public:
    BodyNode(char *_name = NULL);
    ~BodyNode();

    // functions from Node
    void evalR(VectorXd&);
    void init();
    void update(VectorXd&);
    void evalSecondOrder(VectorXd&);
    MatrixXd evalM(VectorXd&);
    VectorXd evalC(VectorXd&);
    VectorXd evalWorldPos(VectorXd& h);	// recursive function
    MatrixXd evalDpDq(VectorXd& lp);	
    void evalSecDpDq(VectorXd&, vector<MatrixXd>&);
    VectorXd evalMomenta(VectorXd&,VectorXd&);
    MatrixXd evalP(VectorXd&);
    MatrixXd evaldLdq(VectorXd&, VectorXd&);
    double evalG();
    VectorXd evaldGdq();

    inline VectorXd evalCOM();
    void draw();
    inline double getMass();

    // Jie's helper functions
    void evalJC();
    void evalJW();
    void evalJCq(int dofIndex);
    void evalJWq(int dofIndex);

    // ori functions
    // Transformation
    MatrixXd getWorldTransform();
  
    // Inverse Transformation
    MatrixXd getWorldInvTransform();
    MatrixXd getLocalInvTransform();
	
    void draw(Vector4d& _color, bool _default, int depth = 0);	// render the entire bodylink subtree rooted here
    void drawHandles(Vector4d& _color, bool _default);	// render the handles

    inline char* getName();
    inline Vector3d getOffset();
    inline void setOffset(Vector3d& _off);
    inline int getModelIndex();
    inline void setModelIndex(int _idx);
    inline BodyNode* getNodeIn();
    inline void setSkel(Skeleton* skel);

    inline void addHandle(Marker *h);
    inline vector<Marker*> clearHandles();
    inline void removeHandle(Marker *h);
    inline int getNumHandles();
    inline Marker* getHandle(int i);
	
    inline Primitive* getPrimitive();
    inline void setPrimitive(Primitive *_p);

    inline void addJointOut(Joint *_c);
    inline int getNumJoints();
    inline Joint* getJointOut(int i);
    inline Joint* getJointIn();
    inline void setJointIn(Joint *_p);

    // wrapper functions for joints
    inline BodyNode* getNodeOut(int i);
    inline int getNumDofs();
    inline Dof* getDof(int i);
    inline bool isPresent(Dof* q);
    inline Matrix4d getLocalTrans();
    inline Matrix4d getLocalDeriv(Dof* q);
{'fraction_non_alphanumeric': 0.0988989382618954, 'fraction_numerical': 0.006685017695635077, 'mean_word_length': 3.714550509731233, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7201007', 'n_tokens_mistral': 1730, 'n_tokens_neox': 1632, 'n_words': 465}