Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[all] Run codespell on the code base + config file #5064

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = CHANGELOG.md
ignore-words-list = Sensable,SensAble,Datas,offsetT,dOut,*/extlibs/*,doubleClick,findOut,inForce,optionA
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ if(SOFA_BUILD_RELEASE_PACKAGE)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${EXTRA_INSTALL_COMMAND}")
set(CPACK_NSIS_MENU_LINKS
"https://www.sofa-framework.org/documentation/" "SOFA User Documentation"
"https://www.sofa-framework.org/api/" "SOFA Developper API"
"https://www.sofa-framework.org/api/" "SOFA Developer API"
"https://github.com/sofa-framework/sofa/discussions" "SOFA Support")
endif()
#######################
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ For more information on forks and pull request, check out [this GitHub guide](ht

### SOFA Developer Certificate Of Origin (DCO)

SOFA is using the [mechanism of the linux project](https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin) to track and secure all issues related to copyrights: the Developper Certificate of Origin (DCO). If you are contributing code or documentation to the SOFA project, and using the git signed-off-by mechanism, you are agreeing to this certificate. This DCO essentially means that:
SOFA is using the [mechanism of the linux project](https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin) to track and secure all issues related to copyrights: the Developer Certificate of Origin (DCO). If you are contributing code or documentation to the SOFA project, and using the git signed-off-by mechanism, you are agreeing to this certificate. This DCO essentially means that:

- you offer the changes under the same license agreement as the project, and
- you have the right to do that,
Expand Down
2 changes: 1 addition & 1 deletion GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Base rules
The base rules are in Google C++ Style Guide: https://google.github.io/styleguide/cppguide.html
All rules below **replace** the corresponding base rules.
For any subject not mentionned below, please refer to the base.
For any subject not mentioned below, please refer to the base.

### Commit message
A correct commit message must therefore be structured as:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ ConstraintAnimationLoop::ConstraintAnimationLoop() :
, d_doCollisionsFirst(initData(&d_doCollisionsFirst, false, "doCollisionsFirst","Compute the collisions first (to support penality-based contacts)"))
, d_doubleBuffer( initData(&d_doubleBuffer, false, "doubleBuffer","Double the buffer dedicated to the constraint problem to make it accessible to another thread"))
, d_scaleTolerance( initData(&d_scaleTolerance, true, "scaleTolerance","Scale the error tolerance with the number of constraints"))
, d_allVerified( initData(&d_allVerified, false, "allVerified","All contraints must be verified (each constraint's error < tolerance)"))
, d_allVerified( initData(&d_allVerified, false, "allVerified","All constraints must be verified (each constraint's error < tolerance)"))
, d_sor( initData(&d_sor, 1.0_sreal, "sor","Successive Over Relaxation parameter (0-2)"))
, d_schemeCorrection( initData(&d_schemeCorrection, false, "schemeCorrection","Apply new scheme where compliance is progressively corrected"))
, d_realTimeCompensation( initData(&d_realTimeCompensation, false, "realTimeCompensation","If the total computational time T < dt, sleep(dt-T)"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class SOFA_COMPONENT_ANIMATIONLOOP_API ConstraintAnimationLoop : public sofa::si
Data<bool> d_doCollisionsFirst; ///< Compute the collisions first (to support penality-based contacts)
Data<bool> d_doubleBuffer; ///< Double the buffer dedicated to the constraint problem to make it accessible to another thread
Data<bool> d_scaleTolerance; ///< Scale the error tolerance with the number of constraints
Data<bool> d_allVerified; ///< All contraints must be verified (each constraint's error < tolerance)
Data<bool> d_allVerified; ///< All constraints must be verified (each constraint's error < tolerance)
Data<SReal> d_sor; ///< Successive Over Relaxation parameter (0-2)
Data<bool> d_schemeCorrection; ///< Apply new scheme where compliance is progressively corrected
Data<bool> d_realTimeCompensation; ///< If the total computational time T < dt, sleep(dt-T)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace sofa::component::collision::detection::algorithm

/**
*x and y value are used to identify this pair, the order is not important but the order of elem1_ and elem2_ is because
*when using intersect funcion we run inter->intersect(elem1,elem2,output), so the intersect method must handle the order you give.
*when using intersect function we run inter->intersect(elem1,elem2,output), so the intersect method must handle the order you give.
*/
CollidingPair(const core::CollisionElementIterator & elem1_,const core::CollisionElementIterator & elem2_,core::collision::ElementIntersector * /*inter*/) :
elem1(elem1_),elem2(elem2_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const int CollisionPipeline::defaultDepthValue = 6;

CollisionPipeline::CollisionPipeline()
: d_doPrintInfoMessage(initData(&d_doPrintInfoMessage, false, "verbose",
"Display extra informations at each computation step. (default=false)"))
"Display extra information at each computation step. (default=false)"))
, d_doDebugDraw(initData(&d_doDebugDraw, false, "draw",
"Draw the detected collisions. (default=false)"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ void DirectSAPNarrowPhase::narrowCollisionDetectionFromSortedEndPoints()
SCOPED_TIMER_VARNAME(scopeTimer, "Direct SAP intersection");
int nbInvestigatedPairs{ 0 };

std::list<int> activeBoxes;//active boxes are the one that we encoutered only their min (end point), so if there are two boxes b0 and b1,
std::list<int> activeBoxes;//active boxes are the one that we encountered only their min (end point), so if there are two boxes b0 and b1,
//if we encounter b1_min as b0_min < b1_min, on the current axis, the two boxes intersect : b0_min--------------------b0_max
// b1_min---------------------b1_max
//once we encouter b0_max, b0 will not intersect with nothing (trivial), so we delete it from active_boxes.
//once we encounter b0_max, b0 will not intersect with nothing (trivial), so we delete it from active_boxes.
//so the rule is : -every time we encounter a box min end point, we check if it is overlapping with other active_boxes and add the owner (a box) of this end point to
// the active boxes.
// -every time we encounter a max end point of a box, we are sure that we encountered min end point of a box because _end_points is sorted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace sofa::component::collision::detection::algorithm

/**
* This class is an implementation of sweep and prune in its "direct" version, i.e. at each step
* it sorts all the primitives along an axis (not checking the moving ones) and computes overlaping pairs without
* it sorts all the primitives along an axis (not checking the moving ones) and computes overlapping pairs without
* saving it. But the memory used to save these primitives is created just once, the first time we add CollisionModels.
*/
class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API DirectSAPNarrowPhase : public core::collision::NarrowPhaseDetection
Expand All @@ -53,7 +53,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API DirectSAPNarrowPhase : pu
/** \brief Returns the axis number which have the greatest variance for the primitive end points.
*
* This axis is used when updating and sorting end points. The greatest variance means
* that this axis have the most chance to eliminate a maximum of not overlaping SAPBox pairs
* that this axis have the most chance to eliminate a maximum of not overlapping SAPBox pairs
* because along this axis, SAPBoxes are the sparsest.
*/
int greatestVarianceAxis() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ void IncrSAP::boxPrune(){

SCOPED_TIMER("Box Prune SAP intersection");

std::deque<int> active_boxes; // active boxes are the one that we encoutered only their min (end point), so if there are two boxes b0 and b1,
std::deque<int> active_boxes; // active boxes are the one that we encountered only their min (end point), so if there are two boxes b0 and b1,
// if we encounter b1_min as b0_min < b1_min, on the current axis, the two boxes intersect : b0_min--------------------b0_max
// b1_min---------------------b1_max
// once we encouter b0_max, b0 will not intersect with nothing (trivial), so we delete it from active_boxes.
// once we encounter b0_max, b0 will not intersect with nothing (trivial), so we delete it from active_boxes.
// so the rule is : - every time we encounter a box min end point, we check if it is overlapping with other active_boxes and add the owner (a box) of this end point to
// the active boxes.
// - every time we encounter a max end point of a box, we are sure that we encountered min end point of a box because _end_points is sorted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API IncrSAP :
void updateEndPoints();

/**
* Sets the end points ID, i.e. each end point in the list after this mehod have its position (ID) updated.
* Sets the end points ID, i.e. each end point in the list after this method have its position (ID) updated.
*/
void setEndPointsID();

Expand Down Expand Up @@ -263,7 +263,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API IncrSAP :

void addCollisionModel (core::CollisionModel *cm) override;

// Unuseful methods because all is done in addCollisionModel
// Useless methods because all is done in addCollisionModel
void addCollisionPair (const std::pair<core::CollisionModel*, core::CollisionModel*>& ) override {}
void addCollisionPairs (const type::vector<std::pair<core::CollisionModel*, core::CollisionModel*> >&) override {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace sofa::component::collision::detection::algorithm
/**
* \brief It is a Ray Trace based collision detection algorithm
*
* For each point in one object, we trace a ray following the oposite of the point's normal
* For each point in one object, we trace a ray following the opposite of the point's normal
* up to find a triangle in the other object. Both triangles are tested to evaluate if they are in
* colliding state. It must be used with a TriangleOctreeModel,as an octree is used to traverse the object.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void RayTraceNarrowPhase::findPairsVolume (CubeCollisionModel * cm1, CubeCollisi
return;


/*construct the octree of both models, when it still doesn't exisits */
/*construct the octree of both models, when it still doesn't exists */
if (!tm1->octreeRoot)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace sofa::component::collision::detection::algorithm
/**
* \brief It is a Ray Trace based collision detection algorithm
*
* For each point in one object, we trace a ray following the oposite of the point's normal
* For each point in one object, we trace a ray following the opposite of the point's normal
* up to find a triangle in the other object. Both triangles are tested to evaluate if they are in
* colliding state. It must be used with a TriangleOctreeModel,as an octree is used to traverse the object.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ TEST_F(TestCollisionPipeline, checkCollisionPipelineWithMonkeyValueForDepth_Open
// Check the returned value.
if(this->checkCollisionPipelineWithMonkeyValueForDepth(depthValue) != depthValue)
{
ADD_FAILURE() << "User provided depth parameter value '" << depthValue << "' has been un-expectedly overriden." ;
ADD_FAILURE() << "User provided depth parameter value '" << depthValue << "' has been un-expectedly overridden." ;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace sofa::component::collision::detection::intersection
using namespace sofa::component::collision::geometry;

BaseProximityIntersection::BaseProximityIntersection()
: d_alarmDistance(initData(&d_alarmDistance, 1.0_sreal, "alarmDistance", "Distance above which the intersection computations ignores the promixity pair. This distance can also be used in some broad phase algorithms to reduce the search area"))
: d_alarmDistance(initData(&d_alarmDistance, 1.0_sreal, "alarmDistance", "Distance above which the intersection computations ignores the proximity pair. This distance can also be used in some broad phase algorithms to reduce the search area"))
, d_contactDistance(initData(&d_contactDistance, 0.5_sreal, "contactDistance", "Distance below which a contact is created"))
{
d_alarmDistance.setRequired(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API BaseProximityIntersect
sofa::core::objectmodel::RenamedData<SReal> contactDistance;


Data<SReal> d_alarmDistance; ///< Distance above which the intersection computations ignores the promixity pair. This distance can also be used in some broad phase algorithms to reduce the search area
Data<SReal> d_alarmDistance; ///< Distance above which the intersection computations ignores the proximity pair. This distance can also be used in some broad phase algorithms to reduce the search area
Data<SReal> d_contactDistance; ///< Distance below which a contact is created
protected:
BaseProximityIntersection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int MeshDiscreteIntersection::computeIntersection(collision::geometry::TSphere<T
}

//However, if the plane has intersected the sphere, then it is
//neccesary to check if the proyected point "projPoint" is inside
//necessary to check if the proyected point "projPoint" is inside
//the triangle.
#define SAMESIDE(ap1,ap2,ap3,ap4) (((cross((ap4-ap3),(ap1-ap3))) * (cross((ap4-ap3),(ap2-ap3)))) >= 0)
if ( (SAMESIDE(projPoint,p0,p1,p2) && SAMESIDE(projPoint,p1,p0,p2) && SAMESIDE(projPoint,p2,p0,p1)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class SOFA_COMPONENT_COLLISION_GEOMETRY_API CubeCollisionModel : public core::Co
{
sofa::type::Vec3 minBBox, maxBBox;
std::pair<Cube,Cube> subcells;
std::pair<core::CollisionElementIterator,core::CollisionElementIterator> children; ///< Note that children is only meaningfull if subcells in empty
std::pair<core::CollisionElementIterator,core::CollisionElementIterator> children; ///< Note that children is only meaningful if subcells in empty

// additional datas for implementing Volino's method for efficient cloth self collision
// additional data for implementing Volino's method for efficient cloth self collision
sofa::type::Vec3 coneAxis;
SReal coneAngle;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void TriangleCollisionModel<DataTypes>::computeBoundingTree(int maxDepth)
if (!isMoving() && !cubeModel->empty() && !m_needsUpdate)
return; // No need to recompute BBox if immobile nor if mesh didn't change.

// set to false to avoid excesive loop
// set to false to avoid excessive loop
m_needsUpdate=false;

type::Vec3 minElem, maxElem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void CollisionResponse::createNewContacts(const core::collision::ContactManager:

if (contact == nullptr)
{
//contact couln't be created: write an error and collision detection output is no longer considered
//contact couldn't be created: write an error and collision detection output is no longer considered
contactCreationError(errorStream, model1, model2, responseUsed);
contactMap.erase(contactIt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class PenalityContactForceField : public core::behavior::PairInteractionForceFie

const type::vector< Contact >& getContact() const { return contacts.getValue();}

// -- tool grabing utility
// -- tool grabbing utility
void grabPoint( const core::behavior::MechanicalState<defaulttype::Vec3Types> *tool,
const type::vector< sofa::Index > &index,
type::vector< std::pair< core::objectmodel::BaseObject*, type::Vec3f> > &result,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void PenalityContactForceField<DataTypes>::addDForce(const sofa::core::Mechanica
{
Coord du = dx2[c.m2]-dx1[c.m1];
Real dpen = - du*c.norm;
//if (c.pen < 0) dpen += c.pen; // start penality at distance 0
//if (c.pen < 0) dpen += c.pen; // start penalty at distance 0
Real dfN = c.ks * dpen * (Real)kFactor;
Deriv dforce = -c.norm*dfN;
df1[c.m1]+=dforce;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ inline sofa::component::collision::geometry::TriangleCollisionModel<sofa::defaul

dpositions.endEdit();

//Editting the velocity of the OBB
//Editing the velocity of the OBB
Data<MechanicalObject3::VecDeriv>& dvelocities = *triDOF->write(sofa::core::VecId::velocity());

MechanicalObject3::VecDeriv& velocities = *dvelocities.beginEdit();
Expand All @@ -89,7 +89,7 @@ inline sofa::component::collision::geometry::TriangleCollisionModel<sofa::defaul
tri->addObject(triCollisionModel);


//editting the OBBModel
//editing the OBBModel
triCollisionModel->init();

return triCollisionModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ inline sofa::component::collision::geometry::SphereCollisionModel<sofa::defaultt

dpositions.endEdit();

//Editting the velocity of the OBB
//Editing the velocity of the OBB
Data<MechanicalObjectRigid3::VecDeriv>& dvelocities = *sphereDOF->write(sofa::core::VecId::velocity());

MechanicalObjectRigid3::VecDeriv& velocities = *dvelocities.beginEdit();
Expand Down Expand Up @@ -130,7 +130,7 @@ inline sofa::component::collision::geometry::SphereCollisionModel<sofa::defaultt

dpositions.endEdit();

//Editting the velocity of the OBB
//Editing the velocity of the OBB
Data<MechanicalObject3::VecDeriv>& dvelocities = *sphereDOF->write(sofa::core::VecId::velocity());

MechanicalObject3::VecDeriv& velocities = *dvelocities.beginEdit();
Expand All @@ -144,7 +144,7 @@ inline sofa::component::collision::geometry::SphereCollisionModel<sofa::defaultt
sofa::component::collision::geometry::SphereCollisionModel<sofa::defaulttype::Vec3Types>::SPtr sphereCollisionModel = New<sofa::component::collision::geometry::SphereCollisionModel<sofa::defaulttype::Vec3Types>>();
sphere->addObject(sphereCollisionModel);

//editting the RigidSphereModel
//editing the RigidSphereModel
sphereCollisionModel->init();
sofa::component::collision::geometry::SphereCollisionModel<sofa::defaulttype::Vec3Types>::VecReal& vecRad = *(sphereCollisionModel->d_radius.beginEdit());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ void LinearSolverConstraintCorrection<DataTypes>::addConstraintDisplacement(SRea

const auto positionIntegrationFactor = l_ODESolver->getPositionIntegrationFactor();

// TODO => optimisation => for each bloc store J[bloc,dof]
// TODO => optimisation => for each block store J[block,dof]
for (int i = begin; i <= end; i++)
{
MatrixDerivRowConstIterator rowIt = constraints.readLine(i);
Expand Down Expand Up @@ -674,7 +674,7 @@ void LinearSolverConstraintCorrection<DataTypes>::setConstraintDForce(SReal* df,
}
}

// course on indices of the dofs involved invoved in the bloc //
// course on indices of the dofs involved invoved in the block //
auto it_dof(Vec_I_list_dof[last_force].cbegin()), it_end(Vec_I_list_dof[last_force].cend());
for(; it_dof!=it_end; ++it_dof)
{
Expand Down
Loading
Loading