Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Perminder <[email protected]>
  • Loading branch information
perminder-17 committed Nov 16, 2024
1 parent 38dcb07 commit 77d870e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
22 changes: 15 additions & 7 deletions avogadro/core/cube.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class Mutex;
/**
* @class Cube cube.h <avogadro/core/cube.h>
* @brief Provide a data structure for regularly spaced 3D grids.
* @author Marcus D. Hanwell
* @author Perminder Singh
*/

class AVOGADROCORE_EXPORT Cube
{
public:
Expand Down Expand Up @@ -275,13 +278,18 @@ class AVOGADROCORE_EXPORT Cube
*/
float getData(int i, int j, int k) const;

/**
* Get the positions of the eight corners of a cube defined by the indices (i, j, k).
* @param i x index
* @param j y index
* @param k z index
* @return Array of positions at the eight corners.
*/
/**
* Retrieves the positions of the eight corners of a cube at grid indices (i, j, k).
*
* The indices (i, j, k) are converted to real-space positions (xpos, ypos, zpos), mapping grid indices to physical coordinates.
* The method returns a cube that spans one step in each of the x, y, and z directions, with step sizes defined by `m_spacing`.
*
* @param i X-index.
* @param j Y-index.
* @param k Z-index.
* @return A `std::array` of eight `(x, y, z)` coordinates representing the cube's corners.
*/

std::array<std::array<float, 3>, 8> getPosCube(int i, int j, int k) const;

protected:
Expand Down
8 changes: 8 additions & 0 deletions avogadro/core/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ class AVOGADROCORE_EXPORT Mesh
*/
const Core::Array<Vector3f>& normals() const;

/**
* @return The number of normals.
*/
unsigned int numNormals() const
{
return static_cast<unsigned int>(m_normals.size());
}

/**
* @return Pointer to the first normal of the specified triangle.
*/
Expand Down
6 changes: 6 additions & 0 deletions avogadro/qtgui/meshgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,12 @@ unsigned char MeshGenerator::calcCaseEdge(bool const& prevEdge, bool const& curr
return 3;
}

unsigned long MeshGenerator::duplicate(const Vector3i&, const Vector3f&)
{
// FIXME Not implemented yet.
return 0;
}

void MeshGenerator::calcTrimValues(int& xl, int& xr, int const& j, int const& k) const
{

Expand Down
7 changes: 7 additions & 0 deletions avogadro/qtgui/meshgenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace QtGui {
* @class MeshGenerator meshgenerator.h <avogadro/qtgui/meshgenerator.h>
* @brief Class that can generate Mesh objects from Cube objects.
* @author Marcus D. Hanwell
* @author Perminder Singh
*
* This class implements a method of generating an isosurface Mesh from
* volumetric data using the marching cubes algorithm. In the case of the
Expand Down Expand Up @@ -107,6 +108,12 @@ class AVOGADROQTGUI_EXPORT MeshGenerator : public QThread
int zstart;
};

/**
* Handles duplicate vertices (Not implemented). Placeholder for future functionality.
*/
unsigned long duplicate(const Vector3i& c, const Vector3f& pos);


/**
* @name Flying Edges
* Methods to implement the "flying edges" method for isosurface mesh generation.
Expand Down

0 comments on commit 77d870e

Please sign in to comment.