KeyFrameList.h
Go to the documentation of this file.
00001 /***
00002  Implementation of keyframe class for keyframe data storage and time-varying tensor field computing
00003  ***/
00004 #ifndef _KEYFRAMELIST_H
00005 #define _KEYFRAMELIST_H
00006 #include "dataStructure.h"
00007 #include "QuadMesh.h"
00008 typedef struct OneKeyFrame{
00009         icVector2 *vec_vals;
00010         icMatrix2x2 *jacobian_vals;
00011         int nverts;
00012         int keyFrameID;        // the frame ID in the total sequence
00013 }OneKeyFrame;
00014 
00015 
00016 
00017 /*   The class of the user specified key frame list 
00018 */
00019 class KeyFrameList
00020 {
00021 public:
00022         OneKeyFrame **keyframes;
00023         int nkeyframes;
00024         int curMaxNum;
00025 
00026         /*    Constructor    */
00027 
00028         KeyFrameList(int initsize = 2);
00029 
00030 
00031         /*    Destructor    */
00032         ~KeyFrameList();
00033 
00034 
00035         /*   release the space of the given pointer to the frame data   */
00036     void release_oneSlice(OneKeyFrame *onekeyframe);
00037 
00038         /*   add one new slice (allocate memory)   */
00039         void add_oneSlice(int nverts = 1, int spec_sliceID = 0);
00040 
00041         /*  add the vector value at a vertex to current frame  */
00042         void add_vec_to_curFrame(int vertID, icMatrix2x2 &jarcobian);
00043 
00044         /*  add the vector value at a vertex to the specified frame  */
00045         bool add_jar_to_specFrame(int frameID, int vertID, icMatrix2x2 &jarcobian);
00046         bool add_jar_to_specFrame(OneKeyFrame *theframe, int vertID,icMatrix2x2 &jarcobian);
00047 
00048     bool add_vec_to_specFrame(int frameID, int vertID, double vx, double vy);
00049     bool add_vec_to_specFrame(OneKeyFrame *theframe, int vertID, double vx, double vy);
00050 
00051 
00052         OneKeyFrame *get_frame_pointer(int frameID);
00053 
00054         /*   save the current design vector field at the specified frame   */
00055         void save_cur_field(int frameID, QuadMesh *obj);
00056 
00057         /*  save the current field to a specified frame in the list 
00058         (assume it has been initialized)  */
00059         void add_curField_to_frame (int pos, QuadMesh *obj, int frameID);
00060 
00061         void copy_frame_to_specFrame(OneKeyFrame *source, int frameID);
00062 
00063         /*   reset the specified frame given the frame ID   */
00064         bool reset_specFrame(int frameID);
00065 
00066         /*   reset the specified frame given the pointer of the frame data   */
00067         void reset_one_frame(OneKeyFrame *onekeyframe);
00068         /*   extend the list   */
00069         bool isFull();
00070 
00071         bool extend(int step = 2);
00072 };
00073 
00074 #endif


tensor_field_nav_core
Author(s): Lintao Zheng, Kai Xu
autogenerated on Thu Jun 6 2019 19:50:56