示例#1
0
        /// <summary>
        /// Returns an instance of the requested feature measurement model (using new).
        /// Returns null if there was no match.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="motion_model"></param>
        /// <returns></returns>
        public override Feature_Measurement_Model create_model(String type, Motion_Model motion_model, float MAXIMUM_ANGLE_DIFFERENCE)
        {
            // Try creating each model that we can and see if the name is the same
            // std::cout << "Creating a " << type << " feature measurement model" << std::endl;
            Feature_Measurement_Model pModel;

            pModel = new Fully_Init_Wide_Point_Feature_Measurement_Model(motion_model, MAXIMUM_ANGLE_DIFFERENCE);
            if (pModel.feature_type == type)
            {
                return(pModel);
            }

            // The partially-initialised model also needs the fully-initalised
            // one that we have just created. Don't delete it - just store it
            Feature_Measurement_Model pFullModel = pModel;

            pModel = new Line_Init_Wide_Point_Feature_Measurement_Model(motion_model, pFullModel);
            if (pModel.feature_type == type)
            {
                return(pModel);
            }
            else
            {
                pModel     = null;
                pFullModel = null;
            }

            return(null);
        }
示例#2
0
        /// <summary>
        /// Returns an instance of the requested feature measurement model (using new). 
        /// Returns null if there was no match.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="motion_model"></param>
        /// <returns></returns>
        public override Feature_Measurement_Model create_model(String type, Motion_Model motion_model, float MAXIMUM_ANGLE_DIFFERENCE)
        {
            // Try creating each model that we can and see if the name is the same  
            // std::cout << "Creating a " << type << " feature measurement model" << std::endl;
            Feature_Measurement_Model pModel;

            pModel = new Fully_Init_Wide_Point_Feature_Measurement_Model(motion_model, MAXIMUM_ANGLE_DIFFERENCE);
            if (pModel.feature_type == type)
                return pModel;

            // The partially-initialised model also needs the fully-initalised
            // one that we have just created. Don't delete it - just store it
            Feature_Measurement_Model pFullModel = pModel;
            pModel = new Line_Init_Wide_Point_Feature_Measurement_Model(motion_model, pFullModel);
            if (pModel.feature_type == type)
                return pModel;
            else
            {
                pModel = null;
                pFullModel = null;
            }

            return null;
        }