From 1db97f7a2cf1f1fe1b892fcfa78d8fdf187adf0a Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Thu, 2 May 2013 09:04:29 +0200 Subject: Added function tng_num_frames_per_frame_set_set diff --git a/include/tng_io.h b/include/tng_io.h index 719d416..621d6b2 100644 --- a/include/tng_io.h +++ b/include/tng_io.h @@ -843,6 +843,20 @@ tng_function_status tng_num_frames_per_frame_set_get int64_t *n); /** + * @brief Set the number of frames per frame set. + * @param tng_data is the trajectory of which to set the number of frames + * per frame set. + * @param n is the number of frames per frame set. + * @details This does not affect already existing frame sets. For + * consistency the number of frames per frame set should be set + * betfore creating any frame sets. + * @return TNG_SUCCESS (0) if successful. + */ +tng_function_status tng_num_frames_per_frame_set_set + (const tng_trajectory_t tng_data, + const int64_t n); + +/** * @brief Get the number of frame sets. * @details This updates tng_data->n_trajectory_frame_sets before returning it. * @param tng_data is the trajectory from which to get the number of frame sets. diff --git a/include/tng_io.hpp b/include/tng_io.hpp index 4a2cabf..4e420b0 100644 --- a/include/tng_io.hpp +++ b/include/tng_io.hpp @@ -1,5 +1,5 @@ #ifndef _TNGIO_HPP -#define _TNGIO_HPP +#define _TNGIO_HPP #include "tng_io.h" @@ -31,7 +31,7 @@ public: friend class Residue; friend class Chain; friend class Molecule; - + //! Normal constructor Trajectory() { status = tng_trajectory_init(&traj); } @@ -448,6 +448,18 @@ public: return status = tng_num_frames_per_frame_set_get(traj,n); } + /** + * @brief Set the number of frames per frame set. + * @param n is the number of frames per frame set. + * @details This does not affect already existing frame sets. For + * consistency the number of frames per frame set should be set + * betfore creating any frame sets. + * @return TNG_SUCCESS (0) if successful. + */ + tng_function_status setNumFramesPerFrameSet(const int64_t n) + { + return status = tng_num_frames_per_frame_set_set(traj,n); + } /** * @brief Get the number of frame sets. @@ -1072,7 +1084,7 @@ public: Molecule(Trajectory * trajectory) { traj = trajectory; - + //status = tng_molecule_init(traj->traj,mol); } /** @@ -1291,4 +1303,4 @@ public: }; } -#endif +#endif diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 0cf92d8..071629f 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -8438,6 +8438,15 @@ tng_function_status tng_num_frames_per_frame_set_get return(TNG_SUCCESS); } +tng_function_status tng_num_frames_per_frame_set_set + (const tng_trajectory_t tng_data, + const int64_t n) +{ + tng_data->frame_set_n_frames = n; + + return(TNG_SUCCESS); +} + tng_function_status tng_num_frame_sets_get(const tng_trajectory_t tng_data, int64_t *n) { @@ -12333,6 +12342,13 @@ tng_function_status tng_num_frames_per_frame_set_get_ return(tng_num_frames_per_frame_set_get(tng_data, n)); } +tng_function_status tng_num_frames_per_frame_set_set_ + (const tng_trajectory_t tng_data, + int64_t *n) +{ + return(tng_num_frames_per_frame_set_set(tng_data, *n)); +} + tng_function_status tng_num_frame_sets_get_ (const tng_trajectory_t tng_data, int64_t *n) -- cgit v0.10.1